I used fileinput to upload images to retool storage, and when I uploaded two images with the same file name but different contents, it was correct after execution. When I enter the retool storage, I find that the content is overwritten but the file name is not overwritten. I did not check overwrite existing file with same name in the Settings. Please see the screenshot, thank you!
Hi @fei2024
Retool Storage doesn't allow multiple files with the same name. By default if you upload multiple files with the same name the first will be the original name and the subsequent files with be the file name with (n) regardless of the contents.
For example, if I upload the same image 4 times with the name cat.jpg
and then 1 different image with the name cat.jpg
, I'll see the following.
However, if I were to enable Overwrite existing files with the same name
then regardless of the contents there would only be one file named cat.jpg
, which is always overwritten by the last photo uploaded with that name.
Let me know if that clear things up for you!
Thank you very much for helping me solve the problem.
This application is to upload product pictures to users, in order to prevent users from having files with the same name, so I do not check "Overwrite existing files with the same name", the file name is normally named as FileName(n).jpg, however, The content was uploaded last.
now I use my file to illustrate, I now simulate 2 entity files 22.jpg with the same file name but different image, after uploading, the file name will show 22.jpg, 22(1).jpg.
Look at the file ids and urls for the following two files. They're different, but the image content is the same,It was uploaded last.
22(1).jpg
a46ad0a4-39b5-4c56-be24-cd249e590fa7
https://xxx.retool.com/api/file/a46ad0a4-39b5-4c56-be24-cd249e590fa7
22.jpg
c25b30db-eca9-4879-b04f-b6193c64dca6
https://xxx.retool.com/api/file/c25b30db-eca9-4879-b04f-b6193c64dca6
If this problem is not easy to solve, can you customize the name of the file when uploading? How to do that?
Sorry for misunderstanding. I haven't been able to reproduce. Would you mind sending a screen recording of how this happens?
Thank you for your reply, I uploaded two files with the same file name but different images, and I also recorded the whole process. After completion, we also saw that the file size and file ID were different, but the images were the same when opening the two files, that is, the last file to upload
Thank for sharing this! I was testing this out and was able to reproduce it once (unfortunately was not recording), but was not able to reproduce the following times I tried. I'll keep testing and figure out why that is.
Your steps are enough to get this reported as a bug in the meantime. Thank you!
Thanks again for your help. If you can solve this problem, it will be a great help to our supplier system.
If it is a bug that can not be solved in a short time, then I would like to ask, you can rename it before uploading, how to do it, thank you
Looks like a fix has been made for this and will be in one of the next few releases!
In meanwhile, you can toggle fx
mode next to file source
, manually set File content like {{ fileInput1.value[0].base64Data }}
and file name to whatever you'd like
The problem has been repaired after testing, thank you!
thank you!
Of course! Thank you for reporting this!