Renaming a file but on download it shows the file's key instead of it's name

Main tech stack: Nextjs: 15v, Drizzle orm: 0.39v, Clerk: 6v, Uploadthing: 7v. Github: https://github.com/webdevkaleem/zip4you Description: So when i upload a file, i generate a random name using cuid2. After upload is completed, a UI pops up where you can rename the media. This works flawlessly as the new name is updated inside Uploadthing and Postgres. The issue is that when i download the media from the client UI, it shows the key instead of the name for the media. But There is one special case where something else happens. I have a tRPC procedure (/api/trpc/media.gmail) which gets a request from zapier and does it's own thing. Here's the catch. When this is procedure runs, it takes the subject from the header and set that as the file name. Now when i download the file from the client UI it shows the name correctly. However In both cases the updated name isn't reflected when i start a download on the client.
GitHub
GitHub - webdevkaleem/zip4you: This is an open-source file distribu...
This is an open-source file distributor designed to facilitate file sharing among users without requiring account creation. It’s a simple solution for distributing files quickly and efficiently. - ...
Solution:
got a PR up with a fix
Jump to solution
24 Replies
webdevkaleem
webdevkaleemOP2w ago
--------------------------------------------------------------------
webdevkaleem
webdevkaleemOP2w ago
Uploadthing
No description
webdevkaleem
webdevkaleemOP2w ago
After client presses the download button
No description
webdevkaleem
webdevkaleemOP2w ago
Js Task 3 is the original name Js Task 3 Rename is the updated name, and this change isn't shown when a user downloads the file For reference when i go to the url which i directly copied from the uploadthing dashboard, it still shows me the original / old file name
julius
julius2w ago
yea this has been a low hanging fruit I've been meaning to fix for a while, but just never got around to - surprised noone has brough it up before
webdevkaleem
webdevkaleemOP2w ago
lol. i wanted to invest more into uploadthing so i was playing around i guess for the time being ill figure smthing out. Its just passion projects for me rn
julius
julius2w ago
i can bump it up some priority levels now that someone actually reported it
Solution
julius
julius2w ago
got a PR up with a fix
webdevkaleem
webdevkaleemOP2w ago
i can't seem to find it i can't find it on github but yes it all works flawlessly now thanks
julius
julius2w ago
Infra isn’t open source
webdevkaleem
webdevkaleemOP2w ago
makes sense
webdevkaleem
webdevkaleemOP2d ago
@julius the renaming fix broke example:
No description
No description
julius
julius2d ago
What’s the file key for that file?
webdevkaleem
webdevkaleemOP2d ago
HMj016y4l9GSIrbFEDpnORuUyJPDiFxNT23StqHVcvXWwB98 just for context i add a random name upon upload using cuid2 that name is being shown with addition of the "test_" keyword which i forgot to remove
julius
julius2d ago
wut
No description
webdevkaleem
webdevkaleemOP2d ago
its a zip file the app lets you zip multiple files together for sharing this is me testing
julius
julius2d ago
I just went to utfs.io/f/HMj016y4l9GSIrbFEDpnORuUyJPDiFxNT23StqHVcvXWwB98
webdevkaleem
webdevkaleemOP2d ago
yes and u downloaded the file the issue is the name of the file which u downloaded, the zip file
julius
julius2d ago
Oh right safari auto-decompresses found the issue - bad merge reverted that chagne for s3 files :/ deploying fix
webdevkaleem
webdevkaleemOP2d ago
thank you
julius
julius2d ago
it's up
No description
webdevkaleem
webdevkaleemOP2d ago
yep. it works now thanks
julius
julius2d ago
sorry for the regression
webdevkaleem
webdevkaleemOP2d ago
not at all. it's not like i have any real users 😂

Did you find this page helpful?