Jump to content
Larry Ullman's Book Forums

Chapter 19 Actual Files Names In "uploads" Rather Than Associated Id's


Recommended Posts

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

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

 Share

×
×
  • Create New...