Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Progress Event is not getting Fired! #12

Open
rodrigoreis22 opened this issue Sep 10, 2014 · 11 comments
Open

Progress Event is not getting Fired! #12

rodrigoreis22 opened this issue Sep 10, 2014 · 11 comments

Comments

@rodrigoreis22
Copy link

I'm trying to upload a mp4 video and the progress bar doesn't move when the file is uploading. Only when the upload finish it moves to 100%.

Do you know what might be happening?

@nukulb
Copy link
Owner

nukulb commented Sep 10, 2014

@rodrigoreis22 can you provide which browser you are using?

I can have a look at the progress problem today, I recently changed some code in that area so possibly I could have broken something as a side affect.

@rodrigoreis22
Copy link
Author

@nukulb I'm using Chrome 37.0.2062.94 on a Mac OS X 10.9.4.

Thanks for digging into this.

@nukulb
Copy link
Owner

nukulb commented Sep 11, 2014

I have managed to reproduce it, I will have a look in more detail this
weekend.

On Thu, Sep 11, 2014 at 1:36 PM, Rodrigo Reis [email protected]
wrote:

@nukulb https://github.com/nukulb I'm using Chrome 37.0.2062.94 on a
Mac OS X 10.9.4.

Thanks for digging into this.


Reply to this email directly or view it on GitHub
#12 (comment)
.

Nukul Bhasin

@danialfarid
Copy link
Contributor

Try PUT method instead of POST.

@rodrigoreis22
Copy link
Author

@danialfarid I changed from POST to PUT and I'm having this error:

PUT https://xxxx.s3.amazonaws.com/ net::ERR_CONNECTION_RESET

@nukulb
Copy link
Owner

nukulb commented Sep 14, 2014

S3 file upload won't accept a 'put'
It has to be a post

Sent from my iPhone

On Sep 14, 2014, at 2:53 AM, Rodrigo Reis [email protected] wrote:

@danialfarid I changed from POST to PUT and I'm having this error:

PUT https://xxxx.s3.amazonaws.com/ net::ERR_CONNECTION_RESET


Reply to this email directly or view it on GitHub.

@nukulb
Copy link
Owner

nukulb commented Sep 14, 2014

@danialfarid So I tried the progress with

"ng-file-upload": "~1.2.9" and progress works perfectly.

With the latest ng-file-upload the progress event never gets fired.

@danialfarid Would you like me to open an issue with ng-file-upload?

@rodrigoreis22 you can downgrade the ng-file-upload to

 "ng-file-upload": "~1.2.9"

in the bower.json file and progress should work perfectly. I will work with @danialfarid and get this resolved and notify you on this github issue.

@nukulb nukulb changed the title Not showing progress for larger files Progress Event is not getting Fired! Sep 14, 2014
@rodrigoreis22
Copy link
Author

@nukulb sounds good. Thanks guys.

@danialfarid
Copy link
Contributor

The FileAPI version is changed since version 1.4.0. It is probably because of that and an issue should be opened on FileAPI github once we know exactly what version of FileAPI is not working and could provide a jsfiddle or something to prove.

@danialfarid
Copy link
Contributor

The main angular-file-upload demo http://angular-file-upload.appspot.com/ page now has an option to upload to Amazon AWS S3 and the upload progress is working properly. There is a section added to the readme file https://github.com/danialfarid/angular-file-upload/blob/master/README.md#s3 on how to upload to S3. I tried with both angular-file-upload 1.6.7 and 1.6.8 version and the progress bar is working without any problem.

@augiegardner
Copy link

Something about the policy signing wasn't allowing the progress event to fire. I mimicked the demo from the angular-file-upload directly by inspecting the upload.js file on that page. For reference, here's my constructed server side policy using nodejs:
var s3Policy = { "expiration": "2020-01-01T00:00:00Z", "conditions": [ {"bucket": "MY_BUCKET_NAME"}, ["starts-with", "$key", ""], {"acl": "public-read"}, ["starts-with", "$Content-Type", ""], ["starts-with", "$filename", ""], ["content-length-range", 0, 524288000] ] }
and my params passed to the amaon s3 POST request
var dataToPost = { key: 'BUCKET_SUBFOLDER' + file.name, AWSAccessKeyId: s3Params.AWSAccessKeyId, acl: 'public-read', policy: "RETURNED_POLICY_STRING", signature: "RETURNED_SIGNATURE_STRING", "Content-Type": file.type === null || file.type === '' ? 'application/octet-stream' : file.type, filename: file.name };

This was rather frustrating, hopefully it helps someone else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants