question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issue with AngularJS 1.4 and transformRequest and uploading to S3

See original GitHub issue

I have an issue today when I updated my project from Angular 1.3 to 1.4, and it’s probably because now you can’t modify the request header with transformRequest anymore (or at least according to this article). Essentially before I was calling the upload function with these parameters:

        url: my-bucket-url,
        headers: {'Content-Type': file.type},
        method: 'POST',
        transformRequest: function (data, headersGetter) {
          // Headers change here
          var headers = headersGetter();
          delete headers.Authorization;
          return data;
        },
        fields: fieldsData,
        ...

As I had to remove the Authorization token from the header I had to transform my headers before sending the file to S3. But now I see that the Authorization is not getting removed from the headers. Any idea how to fix it? Did anybody test ng-file-upload with Angular 1.4?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:12 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
nukulbcommented, Jun 15, 2015

@danialfarid I suggest closing this.

0reactions
Deklincommented, Sep 22, 2015

We are having an issue with angular transform request and ADDING a header. This is a deprecation since angular 1.2.x which we upgraded from.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't upload files to Amazon S3 using Angularjs with pre ...
When the client uploads a file, it first retrieves a pre-signed URL and then uses this to upload the file directly to my...
Read more >
Upload to Amazon S3 using AngularJS | ryansouthgate.com
Hi ryansouthgate,. I am facing issue in uploading video file in amazon s3. Its giving me "Uncaught ReferenceError: cosole is not defined" error ......
Read more >
react-aws-s3 - npm
Open Source Module to Upload your Media and files into AWS S3 Bucket directly from Front-end React.. Latest version: 1.5.0, last published: ...
Read more >
Uploading To S3 With AngularJS - Cheyne Wallace
A problem which is especially visible when using services like Heroku. Step 1: Add The AWS JS SDK To Your Project. This is...
Read more >
Uploading a File to Amazon S3 Using HTTP POST
The topic uses the example policy and fictitious credentials to show you the workflow and resulting signature and policy hash. You can use...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found