Start a new topic

Kinvey angular upload file cross domain problem

Hi all,



I have some problems with kinvey angular sdk for upload file.

I can successfully create the file entity in files addon, but when I try to upload the file to the address of _uploadURL(google api address), I get this error:



XMLHttpRequest cannot load https://storage.googleapis.com/419b2229ecfd49c3bedb5040bcafdf97/9d6f1c30-1b…PTYfgeQum5ml9hJ3%2Facv7wMrVZBUqHQUGTPZdREwZL%2BeYEMrKjcNHl9MfeD4AhCSf04%3D. Request header field Authorization is not allowed by Access-Control-Allow-Headers.



I am testing with http:localhost:9000/



My code is exactly like [this](https://gist.github.com/vseventer/3835e6cfc5353259afe8 "this")

And if I run chrome with --disable-web-safe option. Kinvey SDK works well.



How can I solve this problem?



Any help is appreciated.



Thanks


> @Mark said:

> Are you using the libraries upload method? It looks like an Authorization header is sent with the request, while that is not necessary (and even forbidden). Any change you might set default headers on [Angulars $http](https://docs.angularjs.org/api/ng/service/$http#setting-http-headers)?



Yes, Exactly the problem. I just deleted some custom header on my $http, and it works well now!

Thanks.
Are you using the libraries upload method? It looks like an Authorization header is sent with the request, while that is not necessary (and even forbidden). Any change you might set default headers on [Angulars $http](https://docs.angularjs.org/api/ng/service/$http#setting-http-headers)?
Login or Signup to post a comment