Coder Social home page Coder Social logo

aheckmann / connect-multipart-gridform Goto Github PK

View Code? Open in Web Editor NEW
18.0 18.0 6.0 155 KB

Connect multipart middleware configured to use MongoDB GridFS for file storage.

Home Page: http://aheckmann.github.com/connect-multipart-gridform

License: MIT License

JavaScript 100.00%

connect-multipart-gridform's People

Contributors

aheckmann avatar godu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

connect-multipart-gridform's Issues

express.bodyParser and connect-multipart-gridform

Hi there,

Being a newbe with node and express I had great difficulties to integrate your module into my application.
It works fine now, no it works great!

But maybe you could just add a small remark to your example stating that you should not use the express.bodyParser as I was doing as I finally discoverd in this topic http://stackoverflow.com/questions/11295554/how-to-disable-express-bodyparser-for-file-uploads-node-js.

So my issue is not an issue with this great module, but I thought it could help some future users of it.

kind regards,
Arthur

set the metadata on uploading

It would be nice to be able to set the metadata of files being uploaded, I would like to set them to {user_id: }, right now I do it by updating the created document but I was wondering if there was a better way.

how to check authorization before streaming the data into mongodb

hi, @aheckmann

It is quite exciting to use this module. I come to a problem when I am going to use it in real world - check req.user before saving the data.
So, I try to use connect-multipart-gridform in this way,

   multipart({
        db : db,
        mongo : mongodb,
        limit: '900mb', 
        **defer:true**
    })

In the routes, add

        app.post('/dfs', dfsRoutes.upload);

then, in the upload method, check the req.user, and it is valid, call next().
if not, end the response.

But it does not work as I think, so I read codes of connect-multipart-gridform, I learned something about multipart and gridform. But I haven't figured out the best solution here.
Can you give me a hand ?
Thanks.

Hain

getting "Client Error: Next object larger than space left in message" error

So my code works ok locally but when I try the same peace of code trying to upload the same file on the prod server (gentoo), I get an error. The error is just a test.txt file with "test" as text inside. Using mongo 2.0.5 on both local and prod server and node v0.6.18.

This is the code I use:

app.post('/upload/', function(req, res, next){
    req.on('complete', function(err, fields, files){
        console.log('done')
    })
});

And this is the error I get on prod with the same uploaded file, same code and same mongodb version:

https://gist.github.com/2872103

Any idea what may be wrong?

Error

Hi,

i'm trying to use this midleware with mongoose but i'm allways getting the following error:

if((self.mode == "w" || self.mode == "w+") && self.db.serverConfig.primary !
                                                                    ^
TypeError: Cannot read property 'primary' of undefined

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.