tellme
tellme

Reputation:

File Upload using Multi Part Request Failure Question

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?

Upvotes: 1

Views: 1776

Answers (3)

Parmeet Singh
Parmeet Singh

Reputation: 51

If you have 95 files you must upload 1 by one. Because if we assume each file size is 1 MB. It would be a 95MB request. In order to perform the maximum successful operation, we should hit Apis multiple to avoid several errors like TimeOut Error, Stream too large error, etc.

Upvotes: 0

Tony BenBrahim
Tony BenBrahim

Reputation: 7290

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.

Upvotes: 0

Phil Reif
Phil Reif

Reputation: 386

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.

Upvotes: 1

Related Questions