On 5/3/05, Marian Briones <[EMAIL PROTECTED]> wrote: > Hi - > > I have a tool where executive committees can upload their meeting > minutes to the site and have them listed. What is the best way to: > > 1) Prevent accidental overwriting with same file names? (I have > thought adding something to the copied file name)? > > 2) Only allow the person who uploaded the file to change the file, > i.e. if they accidently uploaded the wrong file to be able to upload a > new one.
I have something similar, but to save images. What I do is this: 1-Get the file and compute it's md5 checksum. 2-Save the original filename to the database. 3-Save the file under the md5 name (like a68768b8a786a.jpg) 4-Save the md5 name on the database also. So, this will avoid the overwriting, because if a file is indeed overwritten, then you can say the file is the same (well, there are the recent md5 clash technics, but this should be secure enough). This will give you the additional advantage of saving disk space in case someone upload the same file multiple times. If you need the original filename, you have it in the database. I have done this on my own, and it just works. You could do something similar. -- Bruno Lustosa, aka Lofofora | Email: [EMAIL PROTECTED] Network Administrator/Web Programmer | ICQ: 1406477 Rio de Janeiro - Brazil | Community email addresses: Post message: [email protected] Subscribe: [EMAIL PROTECTED] Unsubscribe: [EMAIL PROTECTED] List owner: [EMAIL PROTECTED] Shortcut URL to this page: http://groups.yahoo.com/group/php-list Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/php-list/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
