I’m building a application (a CMS) where user can upload files like images.
My question is how to rename these files to save.
I think generate a GUID (System.GUID.NewGuid()) to save a file is the best way to go. I’m right or exist better approach in this case?
Note: An example of the GUID that is generated: 7c9e6679-944b-7425-40from-e07fc1f90ae7. In that case a image file will be: 7c9e6679-944b-7425-40from-e07fc1f90ae7.jpg
Update:
Users will not interact directly with the name of the file.
If you want better SEO, you should add something before the GUID. Better is to generate your own unique id in combination with something that explains the image/file (because of SEO).
For example if you have an item, the image name can be something like:
itemId-ItemName.jpg