Jump to content

Upload multiple images but send them separately


GuitarGod

Recommended Posts

Hi all,

 

I'm currently using jQuery to upload multiple images, however, sometimes we're uploading 50+ images and each image is copied/resized to a thumbnail on upload, so we're breaching out max execution time among other things. Is it possible to alter jQuery to send each image individually thus keeping within our execution time and allowing us to track progress on each individual upload.

 

So far we have:

$( document ).on( 'submit', 'form[name="upload"]', function() {

            var data = new FormData( this );



            $.ajax({

                  type : 'POST',

                  url : 'upload.php',

                  async : false,

                  cache : false,

                  contentType : false,

                  processData : false,

                  data : data,

                  success : function( response ) {

                        alert( response );

                  }

            });

            

            return false;

      });

HTML is pretty much:

<form name="upload" enctype="multipart/form-data">

<input type="file" id="file_upload" name="file_upload[]" multiple><br>
<input type="submit" value="Upload"></form>

Any help would be appreciated.

 

Cheers!

You could just alter the execution time: figure out how long a single image should take and multiply that by the number of images (then add a bit more just in case), change the time limit accordingly, and do your work.

 

Processing multiple images at once will be a bit faster than each one individually, though I wouldn't expect there to be that huge of a difference.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.