buckeye Posted February 23, 2014 Share Posted February 23, 2014 Is there a way to have the permanent files names in the "uploads" directory be the actual file names (with .jpg, etc.) rather than the associated ID number? Is there a security reason this shouldn't be done? Thank you. Link to comment Share on other sites More sharing options...
Larry Posted February 24, 2014 Share Posted February 24, 2014 You could but there are two problems. One is that if two different users uploaded files with the same name, the newer one would overwrite the older one on the file system. The other is security: it's best to rename files uploaded by users. Link to comment Share on other sites More sharing options...
Antonio Conte Posted February 26, 2014 Share Posted February 26, 2014 One way to "keep" files names is to insert the file/upload information into a database. That way, you can rename the actual file and just display the file name you saved to the database. Use the ID as the primary key for the information and save the image path, uploaded file name and anything else you might want to that way. Link to comment Share on other sites More sharing options...
Recommended Posts