English 中文(简体)
文件上载到地方 亚洲开发银行利用C#司机和GridFS生成断言
原标题:File upload to mongoDB using C# driver and GridFS generates assertion

首先是:

  • 服务器: 乌班图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.

我现在要问一下这究竟是什么原因。 我感谢任何方面。

最佳回答

这是否容易重新产生? 它是否与某个特定档案有关? 让我知道,你是否有任何背后之处。

您是否真正使用服务器中的第1.2.2条? 目前的版本是2.1。

问题回答

暂无回答




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签