0

I am writing a web app, and not sure about how to upload multiple images. I want to make sure that either all images are uploaded successfully, or none of them.

One way is to upload them simultaneously in several thread. However, if one of the uploading process fails, it is difficult to cancel other process and remove uploaded images.

The solution I come up with is to combine the multiple files into a bigger file using some separator, and then server then separates it into original files.

Is my solution appropriate? Or are there any better solutions?

HanXu
  • 5,357
  • 5
  • 48
  • 73

1 Answers1

0

You will need some functional to check all files after all files have been uploaded. The simplest way - using standart form/multipart POST with all files in one request. But of course it is not so elegant. Another way - using one of popular and well tested plugin, for example - https://github.com/blueimp/jQuery-File-Upload

Semjon
  • 923
  • 6
  • 16