Closed booni3 closed 4 years ago
I think this should probably be done on the client side. I'd have to look into it to see how to associate the uploaded file with the original file on the client side, but that should be possible.
Hi, any news on this? I also need to get the original file name(s) of whatever is uploaded. I can enable the file rename plugin so the end-user can set their own file name, but this package completely ignores the name (as well as the original filename) because of the use of tempnam
.
Edit: Why are you using tempnam
anyway? The filename is encrypted before being sent to the client already. Could we use that to generate a unique filename?
@mikemand You can get that information from UploadedFile
instance
The workflow is intended to be like:
There is no need to store any real information about the file in step 1 as everything else should be handled by your frontend/backend code.
I needed a way to get the original filename of the uploaded file. I am sure there are a few ways to do this. It could probably be done on the client side, but when uploading multiple files we would need a way to link each of the serverId's back to the filename. I also tried by storing in the session but this is not possible due to the API route, I believe. I have therefore chosen to save the filename into the Cache with a 60 minute expiry. This is working well for my purpose so thought I would share and get your thoughts.