[SERVER-14363] Implement an ability to append file Created: 26/Jun/14  Updated: 10/Dec/14  Resolved: 27/Jun/14

Status: Closed
Project: Core Server
Component/s: GridFS
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Oleg Poludnenko Assignee: Ramon Fernandez Marina
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

 Description   

What we are doing:
1. We have several web servers
2. We are uploading some big file (e.g. 100Mb)
3. The file is chunked on the client-side (e.g. by plupload, etc)
4. We are using MongoDB GridFS to store uploaded files.

What problems we have:
1. There is no possibility to append the next uploaded chunk to the already stored in DB.
2. Also we can't store glue the chunks on a web server before saving into DB, because each file chunk is sended by load balancer to an unpredictable web server. So chunks are uploaded to different web servers.

What the purpose is:
1. Implement a new method appendBytes(id, bytes)
2. Implement a new method appendFile(id, filename)



 Comments   
Comment by Ramon Fernandez Marina [ 27/Jun/14 ]

Hi ua.oleg,

since this is not related to the SERVER project I'm going to mark this ticket as resolved. I would suggest you post on the mongodb-users group
or Stack Overflow with the mongodb tag if you need further assistance. You may also consider opening a ticket on the PHP driver project and request this functionality as an enhancement.

Comment by Oleg Poludnenko [ 26/Jun/14 ]

matt.kangas@10gen.com, thank you for the links.

I'm using PHP driver and it doesn't provide this feature.

Comment by Matt Kangas [ 26/Jun/14 ]

ua.oleg, which MongoDB client library are you using to insert files to MongoDB?

GridFS is almost entirely implemented in MongoDB client libraries. There is very little code in the server specific to GridFS. (Just one command, filemd5.) I believe the C# driver allows you to append to a GridFS file via its MongoGridFSStream class. Other drivers may or may not provide this capability.

For more info:

http://docs.mongodb.org/manual/reference/gridfs/
http://www.kchodorow.com/blog/2010/02/11/mongo-mailbag-2-updating-gridfs-files/

Generated at Thu Feb 08 03:34:36 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.