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
rename file name before upload to s3 #722
Comments
edit - I was wrong |
Anyway that you can share the code you would use inside the processing event? I have just file.name = "somenewname" but I don't think thats correct because its not working. Thanks. |
Looks like the File object's |
Not sure what you mean by S3, but I did manage to track an ID number using a hidden form variable and setting its value in the success routine. However, that only works for maxfiles set to just 1. For this project, I only allow for 1 file to be dropped so it works for me for now, but it would be great if I could have a solution for a future project that needs to track multiple files. I'm not very savvy in javascript, but if I could figure a way to create a new variable for each item that I could access much like we do with file.name (something like file.ID) then that would solve the issue. I just don't know javascript well enough to do it. |
Actually, just figured out how to make this work with multiple files as well. Basic function is to create a dynamic hidden field upon the successful completion of each upload with the id/name based on the file.name but encoded for spaces and etc, an then using the file.name field in the removal process to recreate the encoded field name and then reading its value into a variable. That variable can be an ID, different name or what ever. Let me know if you want to see my code. It works great. |
I am submitting directly to s3 using dropzone.js. it works great except when the file name has spaces in it. Is there any way to change the file name before submitting to s3 (url friendly filename)??
The text was updated successfully, but these errors were encountered: