Node-restify: Multiple File Upload

Created on 15 Jun 2014  路  2Comments  路  Source: restify/node-restify

Uploading multiple files seems to be working fine but instead of getting a list of the files uploaded I only get that last file that was uploaded. Note I'm uploading through one file input not multiple file inputs. I would guess multiple inputs would work fine but I don't want to use multiple inputs for this app.

Here is a console.log of req.files

{
    "files[]": {
        "size": 5593,
        "path": "/tmp/app-files/5291c6d4cece951749845fa5881ebb12",
        "name": "file-4.csv",
        "type": "text/csv",
        "mtime": "2014-06-15T13:45:55.808Z"
    }
}
Bug

Most helpful comment

I got an array of the uploaded files instead of just the last one after making the changes I suggested ( https://github.com/mcavage/node-restify/commit/fb2c6cb710ae0a5721fb51f429386da0f3c3eb33 )

and adding multiples: true to the options:

server.use(restify.bodyParser({
    maxBodySize: 0,
    uploadDir: os.tmpdir(),
    multiples: true
}));

All 2 comments

I got an array of the uploaded files instead of just the last one after making the changes I suggested ( https://github.com/mcavage/node-restify/commit/fb2c6cb710ae0a5721fb51f429386da0f3c3eb33 )

and adding multiples: true to the options:

server.use(restify.bodyParser({
    maxBodySize: 0,
    uploadDir: os.tmpdir(),
    multiples: true
}));
Was this page helpful?
0 / 5 - 0 ratings

Related issues

sloncho picture sloncho  路  3Comments

talha-asad picture talha-asad  路  6Comments

nodesocket picture nodesocket  路  4Comments

Sigurthorb picture Sigurthorb  路  4Comments

anuxs picture anuxs  路  3Comments