Page 1 of 1

How to delete a file from server after download

Posted: Tue May 26, 2009 7:33 pm
by ligaci
Hello All :)
I am coding a new file system for my recent project. I dont want to avoid downloading from server directly via a direct link and i decided to copy files to a temporary directory for download. So i need delete temporary files from disc after download session. Do you have any idea about how can i do that ^^

Thanks for your help :drunk:

Re: How to delete a file from server after download

Posted: Tue May 26, 2009 9:39 pm
by mikemike
You could stream the files rather than just downloading them, probably a better option if you only want them downloaded once.

Re: How to delete a file from server after download

Posted: Tue May 26, 2009 9:41 pm
by Zoxive
Or you could use a cron job to delete the files after so long.

Re: How to delete a file from server after download

Posted: Fri May 29, 2009 4:07 am
by achintha
u can use unlink function.but I think that function is disable on lot of servers.
so if you google it you will be find a good solution than copy & deleting.

Re: How to delete a file from server after download

Posted: Fri May 29, 2009 10:30 am
by Benjamin
Forum Rules wrote:11. Please use proper, complete spelling when posting in the forums. AOL Speak, leet speak and other abbreviated wording can confuse those that are trying to help you (or those that you are trying to help). Please keep in mind that there are many people from many countries that use our forums to read, post and learn. They do not always speak English as well as some of us, nor do they know these aberrant abbreviations. Therefore, use as few abbreviations as possible, especially when using such simple words.
You may also want to read:
  1. General Posting Guidelines
  2. Posting Code in the Forums
  3. PHP Manual
  4. PHP Tutorials