From: Ashley Sheridan on 25 Jan 2010 05:32 On Mon, 2010-01-25 at 10:03 +0000, SED wrote: > Hi, > > Can anyone point me to tutorials on how to change a filename for each > download? My goal is to give the downloader a random name for a picture or a > document, so he will never know what the original filename is. > > Regards, > Summi > > > > I save the file using the temp filename given to it by PHP during the upload process. If that's not possible, then some sort of hash (MD5 for example) of the original file name would suffice. Then, when the user requests that file, they have to request it with a URL like file.php?file=hashname The added benefit of this is that you can verify the user is logged in or not too. The only problem would be if you were serving media files, as no plugins I know of send all the correct headers for the media file request, so your browser would see it as an anonymous request. Thanks, Ash http://www.ashleysheridan.co.uk
|
Pages: 1 Prev: http vs https Next: MySQL ID -- what happens when you run out of range? |