CORS issue with client side Upload / ChunkURI

  • 1
  • Problem
  • Updated 6 months ago
I'm trying to use javascript client side to upload a file to a Sharefile folder. I've added my app's domain as a trusted domain through my sharefile account, which allows CORS requests to [mysubdomain].sharefile.com to go through. So I can successfully get a ChunkURI back from this call:

https://[mysubdomain].sharefile.com/sf/v3/Items([my-folder-id])/Upload

Then the ChunkURI I get back is on the domain "storage-ec2-914.sharefile.com". When I then try to post a request to this URI, the request is blocked with reason:

missing token ‘authorization’ in CORS header ‘Access-Control-Allow-Headers’ from CORS preflight channel

Do I need to do something else to make sure my app's domain gets added as a trusted domain for the upload servers?
Photo of Joe Boettcher

Joe Boettcher

  • 3 Posts
  • 1 Reply Like

Posted 6 months ago

  • 1
Photo of Eliezer Encarnacion

Eliezer Encarnacion, Official Rep

  • 731 Posts
  • 102 Reply Likes
Joe,

On the request sent to the Chunk Uri, are you sending an "Authorization" header? If so, remove it and try again, the ChunkURI call does not need it and the CORS endpoint will not allow it.

Eli
Photo of Joe Boettcher

Joe Boettcher

  • 3 Posts
  • 1 Reply Like
That was it. Thanks for your help!