首先是:
服务器: 乌班图10.04服务器
mongod ——————
db edition v1.2.2, pdfile edition 4.5
Wed Nov 23 11:35:42 git edition: nogitvert
客户:Windows 7 64bit, VS2010 app, 采用C#正式司机诉1.3。
I m trying to store a png image in the mongoDB using the GridFS. My code looks like this:
var GridFSInfo = DB.GridFS.Upload(TextureFileName, TextureFileName);
Running this code I get the following exception
An unhandled exception of type MongoDB.Driver.GridFS.MongoGridFSException occurred in MongoDB.Driver.dll
Additional information: Upload client and server MD5 hashes are not equal.
I have tried to find info on this error, but I seem to be the only person having trouble with this :(
服务器记录没有出现任何错误,我发现:
Wed Nov 23 11:42:23 connection accepted from 141.3.89.168:16861 #159
Wed Nov 23 11:42:25 building new index on { _id: ObjId(000000000000000000000000) } for ObjectDBTest.fs.files...
Wed Nov 23 11:42:25 Buildindex ObjectDBTest.fs.files idxNo:0 { name: "_id_", ns: "ObjectDBTest.fs.files", key: { _id: ObjId(000000000000000000000000) } }
Wed Nov 23 11:42:25 done for 0 records 0secs
Wed Nov 23 11:42:25 info: creating collection ObjectDBTest.fs.files on add index
Wed Nov 23 11:42:25 building new index on { filename: 1, uploadDate: 1 } for ObjectDBTest.fs.files...
Wed Nov 23 11:42:25 Buildindex ObjectDBTest.fs.files idxNo:1 { _id: ObjId(4ecccd0382522c02f8e58d75), name: "filename_1_uploadDate_1", ns: "ObjectDBTest.fs.files", key: { filename: 1, uploadDate: 1 } }
Wed Nov 23 11:42:25 done for 0 records 0secs
Wed Nov 23 11:42:25 building new index on { _id: ObjId(000000000000000000000000) } for ObjectDBTest.fs.chunks...
Wed Nov 23 11:42:25 Buildindex ObjectDBTest.fs.chunks idxNo:0 { name: "_id_", ns: "ObjectDBTest.fs.chunks", key: { _id: ObjId(000000000000000000000000) } }
Wed Nov 23 11:42:25 done for 0 records 0secs
Wed Nov 23 11:42:25 info: creating collection ObjectDBTest.fs.chunks on add index
Wed Nov 23 11:42:25 building new index on { files_id: 1, n: 1 } for ObjectDBTest.fs.chunks...
Wed Nov 23 11:42:25 Buildindex ObjectDBTest.fs.chunks idxNo:1 { _id: ObjId(4ecccd0382522c02f8e58d76), name: "files_id_1_n_1", ns: "ObjectDBTest.fs.chunks", key: { files_id: 1, n: 1 }, unique: true }
Wed Nov 23 11:42:25 done for 0 records 0secs
Wed Nov 23 11:42:29 end connection 141.3.89.168:16861
This looks to me like the file transfer is initiated but then something goes wrong. I triplechecked that the file exists. I used the mongofiles command line utility to see if the GridFS works and everything is fine there, upload of files is no problem. My app also works fine if I do not make the GridFS upload and only use standard BSON document manipulation. I can insert, search, delete fine, so the connection to the server works.
我现在要问一下这究竟是什么原因。 我感谢任何方面。