-
Notifications
You must be signed in to change notification settings - Fork 496
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 upload file with custom name to s3(using s3store)? #333
Comments
tusd does not have a native feature for this but you can rename the upload after it is completed. I added a FAQ entry for this: https://github.com/tus/tusd/blob/master/docs/faq.md#how-can-i-keep-the-original-filename-for-the-uploads |
S3 doesn't support rename directly, meaning you will need to do a copy and delete, which can be extremely slow, sometimes taking as much time as the upload itself. |
I know this may not be a satisfying answer for you, but if renames are to slow, you might have design your system without using the original file names. We are open to discuss alternative solutions but tusd currently does not offer such a feature. Closing this issue since the original question was answered. |
Sadly that probably won't do for the kind of system we have in place that will use tusd. So we will have to either cope with the slow renames, or I'll might just try and see what it will take to add support to use the passed name instead of random IDs to tusd. |
possibly fix for tus#488 - bumped alpine runtime in dockerfile - get rid of [unmaintained](bmizerany/pat#17) routing library bmizerany/pat - fixed CORS request test (status must be just 404, not 405, consequences of bmizerany/pat)
Question
Hi, my sincere apologies if this is a stupid question but I'm unable to find a way to upload files to s3 with a custom name and headers. I am using s3 store to directly upload files to my bucket.
I am able to read the original filename once the file is uploaded(below is the code), but how do I use this name while uploading? Do I need to rename the file once it is uploaded or is there a way to pass it before the upload starts? Any help would be really appreciated.
go func() { for { event := <-handler.CompleteUploads filename, filetype := event.Upload.MetaData["filename"], event.Upload.MetaData["filetype"] fmt.Println("Uploaded. File Details -->> ", filename, filetype) } }()
Setup details
The text was updated successfully, but these errors were encountered: