About file naming #53
-
Hi, first of all, if Rahul is listening, I would really like to thank him for this code, which is fabulous. Then, I'm quite new to these kind of jobs and to Laravel too. I was just wandering: what's the reason why uploaded files have a changed encrypted name? What security (I guess) dangers does this solve? Why can't I leave the original file name? Also, say I'm fine with how the files are renamed in temp directory. How can I move them to the public directory keeping their new name? In your example files are re-renamed a second time before moving. I don't feel this need right know, since then I should implement some checks about not naming them like some other image already uploaded, for not to overriding it. How can I get the name used in temp? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @stratboy, welcome here.
It prevents exposing the filepond model id used internally so that another user can't access someone else's file by guessing the id.
You can get the actual name from |
Beta Was this translation helpful? Give feedback.
Hi @stratboy, welcome here.
It prevents exposing the filepond model id used internally so that another user can't access someone else's file by guessing the id.
You can get the actual name from
getFile()
andgetModel()
methods here. Dump the output you get from these two methods to have a better understanding.