views:

639

answers:

2

Is HTTPS Multipart file upload request a batch process? That is, if I have 99 files, and if the upload fails after file 95 has been uploaded, will that rollback the entire set?

A: 

I would assume that the entire set is rolled back, if you use plain HTTP(S) POST requests, as all uploads are POSTed in the same HTTP request. However, you could use JavaScript/AJAX to upload files individually, in a single request per file.

Phil Reif
You cannot send files over XHR requests. You can, however, send them to an iframe separately (and dynamically generate each form to post if they are visibly coming from one big form), or asynchronously send them through Flash or Java or something like that.
eyelidlessness
A: 

It depends what happens on the server. If you have a single multipart request with 99 files, and as you read the stream, you save each file, then a failure on the 95th file will mean the first 94 files will have been processed and saved. If you need to rollback, you usually would have to implement that yourself.

Tony BenBrahim