I'm using the blueimp jquery file uploader in conjunction with Amazon S3. The only issue I have is that I'm unable to accurately update my progress bar based on the server side status of the image upload.
I'm also using an older version of PHP (5.3), is there a solution or a workaround that I can use to retrieve the server side progress?
Here is the jquery I'm currently calling:
var url = 'photos/index.php';
$('#fileupload').fileupload({
url: url,
dataType: 'json',
done: function (e, data) {
$.each(data.result.files, function (index, file) {
// display the image preview
});
},
progressall: function (e, data) {
//console.log(data);
var progress = parseInt(data.loaded / data.total * 100, 10);
$('#progress .bar').css(
'width',
progress + '%'
);
}
});
if your uploading directly your file directly to S3 Bucket through your PHP code, then it is impossible to show upload progress. Amazon S3 currently have no support for this. If you want to show any upload progress, show the upload progress of your server. After that move the uploaded file from your server to S3 Bucket. But in this way, the progress bar will take some time to complete on 98%-100%, because during that time only uploaded file will be moved to S3.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With