Uploading Multiple Files
ytzvan opened this issue · 7 comments
I'm using the adapter and works great when uploads a single flie, but I got the following error when try to upload multiple files using one single input file form: ERROR ON RECEIVER :: [Error: Request aborted]
Any thoughs ?
Thanks for reporting, could you help me reproduce your error?
Correct me if I'am wrong, but you're saying that such a request fails? ( I took the code from the adapter tests and added a second file ).
function uploadTwoFiles(i, cb) {
var httpRequest = request.post(baseurl+'/upload', onResponse);
var form = httpRequest.form();
form.append('foo', 'hello');
form.append('bar', 'there');
form.append('avatar', <some file here>);
form.append('another File', <the other file> );
// Then check that it worked.
function onResponse (err, response, body) {
if (err) return cb(err);
else if (response.statusCode > 300) return cb(body || response.statusCode);
else cb();
}
}
Hello @lukasreichart, the request fails when I use one input type="file" form. For example, here's my controller action:
req.file('pictures').upload({
adapter: require('skipper-azure'),
key: storageAccount,
secret: accessKey,
container: 'default'
}, function(err, files) {
if(!err) {
return res.json(cdn + files[0].fd);
} else {
return res.send(err);
}
});
And my HTML form looks like this:
<div class="form-group">
<label for="exampleInputFile">File input</label>
<input type="file" id="pictures" name="pictures" multiple="multiple">
</div>
If in the field I only attach 1 file, It works well, but if I attach 2 files, then I got the error.
I want to use only one input for upload multiple files.
Okay, I'll look into this on the Weekend.
The solution I found is use http://www.dropzonejs.com/, you can select multiple files, but the library upload one each. It's not the best solution but it's a way to achieve my goal.
Ok do you now if uploading multiple files works with other skipper adapters?
Not now. I'll try it with skipper disk and skipper s3 and send you feedback.
El Monday, October 26, 2015, Lukas Reichart notifications@github.com
escribió:
Ok do you now if uploading multiple files works with other skipper
adapters?—
Reply to this email directly or view it on GitHub
#4 (comment)
.
Ytzvan A. Mastino
http://compreoalquile.com+507-6780-9892
Has anything happened with this issue? Bumped into this too