sudhanshug
Explore posts from serversTTCTheo's Typesafe Cult
•Created by sudhanshug on 10/21/2024 in #questions
[Rails + UT] /v6/prepareUpload not returning presigned URL
129 replies
TTCTheo's Typesafe Cult
•Created by sudhanshug on 10/21/2024 in #questions
[Rails + UT] /v6/prepareUpload not returning presigned URL
I am on rails, there is no concept of file route.
you dont need to register the upload if you are not using any FileRouteok this is news, will try that
and you can generate signed url without extra requestI am aware of this but the crypto is not matching with what UT server expects and I gave up and used prepareUpload
129 replies
TTCTheo's Typesafe Cult
•Created by sudhanshug on 10/21/2024 in #questions
[Rails + UT] /v6/prepareUpload not returning presigned URL
Okay, I will give you a rundown since you are new on this thread. I am trying to do server uploads and here are the issues I am facing:
With v6 uploadFile, the file is uploaded correctly but it is not available immediately, my client receives an empty response when requesting the file (via an <img tag). This is fixed on immediately reloading my page, so I am assuming the lag is ~1sec.
With v7 prepareUpload, I will have to generate the signed url, register the upload, and then upload the file (3 calls). Since my use case is server uploads, I do not need a callback and hence want to avoid the upload registration entirely. If i dont register the upload, the PUT request never resolves and the file is stuck in uploading state.
Lmk if that makes sense 🙂
129 replies
TTCTheo's Typesafe Cult
•Created by sudhanshug on 10/21/2024 in #questions
[Rails + UT] /v6/prepareUpload not returning presigned URL
i tried that and it looks like the PUT request waits till the file-key is registered with UT
129 replies
TTCTheo's Typesafe Cult
•Created by sudhanshug on 10/21/2024 in #questions
[Rails + UT] /v6/prepareUpload not returning presigned URL
for my server uploads, i dont want a callback - can i pass nil to callback url and slug in the router-metadata request?
129 replies
TTCTheo's Typesafe Cult
•Created by sudhanshug on 10/21/2024 in #questions
[Rails + UT] /v6/prepareUpload not returning presigned URL
I suppose i need to register the upload using the route-metadata endpoint, right? Would've been nice if I didn't have to do that.
129 replies
TTCTheo's Typesafe Cult
•Created by sudhanshug on 10/21/2024 in #questions
[Rails + UT] /v6/prepareUpload not returning presigned URL
alright, thanks
129 replies
TTCTheo's Typesafe Cult
•Created by sudhanshug on 10/21/2024 in #questions
[Rails + UT] /v6/prepareUpload not returning presigned URL
How is the upload request structured? What are the query params/headers or body I need to send
129 replies
TTCTheo's Typesafe Cult
•Created by sudhanshug on 10/21/2024 in #questions
[Rails + UT] /v6/prepareUpload not returning presigned URL
alright, if i get the presigned url using the prepareUpload api - how do i upload the file?
129 replies
TTCTheo's Typesafe Cult
•Created by sudhanshug on 10/21/2024 in #questions
[Rails + UT] /v6/prepareUpload not returning presigned URL
ok
129 replies
TTCTheo's Typesafe Cult
•Created by sudhanshug on 10/21/2024 in #questions
[Rails + UT] /v6/prepareUpload not returning presigned URL
lol - I have both frontend and backend uploads.
129 replies
TTCTheo's Typesafe Cult
•Created by sudhanshug on 10/21/2024 in #questions
[Rails + UT] /v6/prepareUpload not returning presigned URL
but I need to do server uploads
129 replies
TTCTheo's Typesafe Cult
•Created by sudhanshug on 10/21/2024 in #questions
[Rails + UT] /v6/prepareUpload not returning presigned URL
i am using v7 sdk, i am using v6 here because the rest api docs didnt have any docs for v7 server upload
129 replies
TTCTheo's Typesafe Cult
•Created by sudhanshug on 10/21/2024 in #questions
[Rails + UT] /v6/prepareUpload not returning presigned URL
Can you try a server upload? Create an API that:
1. uploads the file
2. returns the file url
Here is how I am uploading the file
It's ruby code, but should be easy to understand. Faraday is a http client library.
129 replies
TTCTheo's Typesafe Cult
•Created by sudhanshug on 10/21/2024 in #questions
[Rails + UT] /v6/prepareUpload not returning presigned URL
Huh, but the file is uploaded from our server for sure (because my request only resolves when the upload request resolves). Is there a quick way to know the actual status of the file?
I can create a client component which retries when it sees a 202 response, but clearly that is not a proper solution 🙂
129 replies
TTCTheo's Typesafe Cult
•Created by sudhanshug on 10/21/2024 in #questions
[Rails + UT] /v6/prepareUpload not returning presigned URL
I have an API which uploads the image and returns the file url on successful upload which is utfs.io/f/<f-key>. My expo frontend tries to render the file using this url but it fails because utfs.io/f/<f-key> returns an empty response with status 202.
This is what i mean by "upon upload when I request the file" .
I dont know the exact delay but i am seeing the image on a reload post upload. Can you check your backend APIs to see when 202 is returned?
129 replies
TTCTheo's Typesafe Cult
•Created by sudhanshug on 10/21/2024 in #questions
[Rails + UT] /v6/prepareUpload not returning presigned URL
if I reload my page, which re-requests the file, it works fine magically - probably you guys take some time to serve the file?
129 replies
TTCTheo's Typesafe Cult
•Created by sudhanshug on 10/21/2024 in #questions
[Rails + UT] /v6/prepareUpload not returning presigned URL
129 replies
TTCTheo's Typesafe Cult
•Created by sudhanshug on 10/21/2024 in #questions
[Rails + UT] /v6/prepareUpload not returning presigned URL
I've tried everything - using hex hmac signature with and without prefix, using b64 of the binary signature. nothing seems to work (copying your py library / following the uploading files doc)
129 replies
TTCTheo's Typesafe Cult
•Created by sudhanshug on 10/21/2024 in #questions
[Rails + UT] /v6/prepareUpload not returning presigned URL
Yo, getting "failed to verify url" error when the client tries to upload the file to the presigned url, how can i debug what's happening.
the url in question:
It is probably failing at hmac signature comparison, can you share the code you guys have for comparing signatures
129 replies