title: Image upload performance issue with Amazon S3 and jqueryfileupload plugin
body: <p><br/>I have another issue with amazon and its related to file uploads.I am using <a href="https://github.com/blueimp/jQuery-File-Upload" rel="nofollow">jqueryFileUpload</a> and amazon API's to uplaod files to amazon S3.I have succeeded in uploading it,but it involves a trick.<br/>
       I had to store the image on my server and then move it to S3 from there using <code>putObjectFile</code> method of S3.Now the plugin comes with great functions to crop/resize images and I have been using them since long.Now when I integrate the plugin with AWS,i am facing <strong>performance issues</strong> with upload.The time taken for uploads is longer than normal and this raises questions of us using AWS S3 over traditional way.<br/>
       I had to make changes to my <a href="https://github.com/blueimp/jQuery-File-Upload/blob/master/server/php/UploadHandler.php" rel="nofollow">UploadHandler.php</a> file to make it work.These are the changes made.i added a part of AWS upload code to the file from line <strong>735 to 750</strong></p>
  
  <pre><code>     $bucket = "elasticbeanstalk-2-66938761981";
       $s3 = new S3(awsAccessKey, awsSecretKey);
       $response = $s3-&gt;putObjectFile($file_path,$bucket,$file-&gt;name,S3::ACL_PUBLIC_READ);
       $thumbResponse = $s3-&gt;putObjectFile('files/thumbnail/'.$file-&gt;name,$bucket,'images/'.$file-&gt;name,S3::ACL_PUBLIC_READ);
       //echo $response;
       //echo $thumbResponse;
       if ($response==1) {
          //echo 'HERER enter!!';
       } else {
            $file-&gt;error = "&lt;strong&gt;Something went wrong while uploading your file... sorry.&lt;/strong&gt;";
       }
       return $file; 
  </code></pre>
  
  <p><a href="https://github.com/mackstann/amazon-s3-php-class/blob/master/S3.php" rel="nofollow">Here</a> is a link to s3 class on git.
  The normal upload to my current server(not amazon),same image uploads in <strong>15 secs</strong>,but on amazon S3 it takes around <strong>23 secs</strong> and I am not able to figure out a better solution.I have to store the image on my sever before uploading to S3 as I am not sure if I can process them <strong>on the fly</strong> and upload directly to S3.<br/>Can anyone suggest the right way to approach the problem?Is it possible to resize the images to different sizes in memory and upload directly to S3 avoiding the overhead of saving it to our server?If yes can anyone guide me in the right direction?<br/>
  Thank you for the attention.</p>