Search code examples
phpjqueryfile-uploadamazon-s3blueimp

blueimp/jQuery-File-Upload direct upload to S3


I'm trying to implement blueimp jquery uploader. I want it to upload directly to S3 (without PHP script in the middle). I found an example here and followed the steps and it worked (partially). But I could not find anything good for muti-file upload.

What I want to do is to have multiple file uploader with a UI feedback just like in this example.

Does anybody have an example to follow for this scenario?

Thanks for your help.


Solution

  • I couldn't get blueimp to perfectly upload to s3, it would still take advantage of my servers tmp folder.

    I ended up switching over to plupload which does upload directly to s3, and has a built in UI ( I just created my own to match the rest of my site).

    I'm not using the multiple file feature but you could do something like

    foreach file you are uploading:

    var multipart_params = {
                'key': config['key'],
                'Filename': config['key'],
                'acl': 'public-read',
                'Content-Type': '',
                'AWSAccessKeyId': config['awskey'],
                'policy': config['policy'],
                'signature': config['signature']
            };
    
    
    up.settings.multipart_params = multipart_params;
    up.start();
    

    Hope that helps :)