where should I send the size of the file been uploaded? I can do it from browser and include the post request, but I am not sure if that’s the preferred way.
got it. I have another question, how do I set ‘expiry’ for Upload-Metadata?
I used golang so I just set use now.Add(time.Hour * 1).String() , in my case it’s 2021-08-31 14:42:15.575272 +0800 CST m=+3606.099049330 , and base64 is MjAyMS0wOC0zMSAxNDo0MjoxNS41NzUyNzIgKzA4MDAgQ1NUIG09KzM2MDYuMDk5MDQ5MzMw
it was working ok when I use non-tus direct upload and pass as JSON request body,
however, when I convert to base64 and put it in the header, I got metadata the error message
I do have another question, which is probably related to uppy, my own server is using a bear token for authorization, however, when uppy post to upload url, it’s including the token as well, and the request would fail with ’ Request header field authorization is not allowed by Access-Control-Allow-Headers in preflight response.’ How can I remove the header in the second request?
Sorry might not have the fullest context to help but maybe you can handle the interaction between the client side and your server separately using a fetch() request from the requests Uppy is making? That way you don’t have to send headers with Uppy?
Stream deliberately doesn’t include the authorization header in the CORS preflight response to make sure no tokens are sent from the client side to Cloudflare accidentally.
I am not sure if I follow your suggestion, from my test, Uppy only works when the server did a 201 redirect. If I use 200 and make another request from Uppy then upload won’t work.
my client code now look like
The hack I can think of is return a one-time signed URL from my server in another request, the signed url itself does not need a bearer token for authorization so Uppy would use that. But it seems too much hassle. one more request and multiple previous headers need to be in URL parameter.