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

Clarify server requirements for upload progress (in README) #207

Closed
Sjors opened this issue May 7, 2014 · 5 comments
Closed

Clarify server requirements for upload progress (in README) #207

Sjors opened this issue May 7, 2014 · 5 comments

Comments

@Sjors
Copy link

Sjors commented May 7, 2014

This had me confused for a bit, but if I understand correctly not all servers return upload progress information. In particular a local development server like WEBrick doesn't. I believe Heroku doesn't either; if you need to see progress there, you'll have to upload directly to Amazon S3.

@Sjors Sjors changed the title Clarify server requirements for upload progress Clarify server requirements for upload progress (in README) May 7, 2014
@danialfarid
Copy link
Owner

I don't think progress event depends on server. Do you have a web link or any document to support this?

@Sjors
Copy link
Author

Sjors commented May 8, 2014

I just noticed my progress callback never gets called when I try it with a WebRick server locally or when I try uploading something to Heroku. That was using Chrome on a Mac, with angular-file-upload-html5-shim loaded before AngularJS. Then I found articles like this one pointing to an Apache module that's required. But maybe I'm just doing something wrong.

@itrethan
Copy link

Hey, I got the same issue here, the progress callback is never invoked. I am using a express backend.

@danialfarid
Copy link
Owner

I added more details to the readme file.

@psahni
Copy link

psahni commented Sep 5, 2014

I am using express.js as backend, and progress block is not getting called. I am uploading file directly to amazon s3

 scope.upload = upload.upload({
                        url: 'https://' + s3Params.bucket + '.s3.amazonaws.com/',
                        method: 'POST',
                        data: {
                            'key' : 'uploads/'+ Math.round(Math.random()*10000) + '$$' + file.name,
                            'acl' : 'public-read',
                            'Content-Type' : file.type,
                            'AWSAccessKeyId': s3Params.AWSAccessKeyId,
                            'success_action_status' : '201',
                            'Policy' : s3Params.s3Policy,
                            'Signature' : s3Params.s3Signature
                        },
                        file: file,
                        headers: { "x-amz-server-side-encryption": 'AES256', 'Content-Type' : 'multipart/form-data'}
                    }).progress(function(evt){
                        console.log('percent: ' + parseInt(100.0 * evt.loaded / evt.total));
                        file.progress =  parseInt(100.0 * evt.loaded / evt.total);
                    }).success(function(){

})

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