Feature request: Multiple files in an HTTP request
Right now, ngx-uploader sends all files through separate HTTP requests, and the concurrency option seems to only be about up to how many HTTP requests are to happen at once.
In my server however, there's some processing of the files, part of which involves DB locks, which in turn means all requests but one get very delayed. It's much more efficient to have all files sent in the same request, at which point the server can respond much faster due to a single DB connection handling all files.
I'm aware that with such an option, the progress would be referring to the progress of all files, not just a particular one, which is a sacrifice I'm willing to make (and as long as the option to send files through separate requests remains, and is the default, I'm sure other users wouldn't mind either).
Implementation wise, FormData.append() can be called multiple times with the same name, resulting in multiple files being sent as part of the same HTTP request. The tricky part is having ngx-uploader be told (and to respect) whether a file is to be sent as part of the same HTTP request or not, and report the progress related to the request, not related to the file.
Agree @boenrobot
@boenrobot did you tried to set the concurrency to 1?
Agreed. This is such an important feature, that it makes the library unusable for me right now. Too bad, I really like it and hope that this is to be implemented soon.
@retailify That doesn't address the issue, it only sends the requests after one another. What we are requesting is to send 1 request in total with all the files attached.
@timmyrosen that is a lot of work. But you are right multipart upload sends all things in one request. As I'm first using the library I've implemented a golang multipart backend and also stumbled over that behavior.