-
Notifications
You must be signed in to change notification settings - Fork 203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to get final name back in client? #598
Comments
Hi, you shouldn't use What probably makes most sense is to have #594, then you can change the file name in the Performing a HEAD request will send back the metadata whenever the client likes to know it. |
I see, thanks 👍 I'm starting to think maybe tus is not the best for my use case. I want users to be able to overwrite existing files as they handle their own files. That's why I need to display the real file names without doing any HEAD requests (or querying my db where I would have stored the real hierarchy). |
You can override files, you just want to do it safely and explicitly. If you only use You can remove the old file in In a future version of the tus spec, it would be nice to send back |
I see what you mean. I do have that extra logic elsewhere:
I should have put my complete code in my initial example, apologies. |
Hello,
I'm using TUS to enable our clients to upload files into our S3 but there is something I'm missing. I use
namingFunction
to remove any weird characters the client would have in their name before storing it.But I can't find how to send that clean name back to the client. I've tried modifying the headers in the
onUploadFinish method
and the header is correctly sent but CORS blocks the browser from reading the new name. I've checked the TUS source code and it seems I can't add anything to the EXPOSED_HEADERS.I could move the renaming logic to the browser but I'd rather not the client being able to reintroduce weird characters.
Thanks in advance for any advice!
The text was updated successfully, but these errors were encountered: