Search code examples
phplaravellaravel-5.3

Is it important to rename image during upload


I found some online tutorial on how to upload image in laravel but I noticed they rename with timestamp the image before the save the file name in the database, my question for this why we should rename the image name with timestamp ? is this for security reason ?

Thank you


Solution

  • Its more of a practice.

    Whatever the file name is we usually keep a record of it in our database and access it by it's id.

    But we can keep things steady if we rename them and bring them all to the same convention.

    More info on laravel filesystems