I want to upload file size higher than 32MB to GCS directly from AngularJS
I could successfully upload to Blobstore
when the file size is less than 32MB using the code given below.
$http.post(uploadUrl, $scope.formData, {
withCredentials: true,
headers: {'Content-Type': undefined},
transformRequest: angular.identity
});
When I try to upload the file using url https://storage.googleapis.com/bucket-name/filename
, I got the following error.
Credentials flag is 'true', but the 'Access-Control-Allow-Credentials' header is ''. It must be 'true' to allow credentials. Origin 'http://localhost:8080' is therefore not allowed access.
When I remove flag withCredentials: true
used in http post, I got response as 403, no error details are given.
I have set the cors as mentioned for the upload bucket
[{"maxAgeSeconds": 3600, "method": ["GET", "POST", "HEAD"], "origin": ["http://localhost:8088"], "responseHeader": ["Content-Type"]}]
How to enable Access-Control-Allow-Credentials
flag in the server?