I am currently using the Zend Framework and have a form for uploading files. An authenticated user has the ability to upload a file that will be stored in a directory in the application, and in a location stored in the database. Thus, it can be displayed as a file that can be downloaded.
<a href="/upload-location/filename.pdf">Download</a>
But what I notice is that a file with the same name will overwrite the file in the uploads directory. There is no error message, and the file name does not increase. Therefore, I think the file should be overwritten (or never loaded).
What are some guidelines I should know when loading, moving or storing these files? Should I always rename files so that the file name is always unique?
source
share