[PHP] Deleting a file after download/upload

2009-06-23 Thread Parham Doustdar
Hi there,
I am writing a PHP FTP client for my project. I want to put a download option 
and an upload option, but I don't know how. My problem is this:
How can I make the server the PHP script is on delete the file after uploading 
it to the SFTP, or after the user has finished downloading it from the server 
the PHP script is on?
Let me put the question this way.
My server connects to an FTP. Then, it downloads a file from the FTP, and then 
sends me the link to that temperary file on the server. Now, when I download it 
from my server, my script should delete the file. How can I make it wait until 
the download of the file is finished?
Same goes for uploading.
Thanks!

-- 
---
Contact info:
Skype: parham-d
MSN: fire_lizard16 at hotmail dot com
email: parham90 at GMail dot com

RE: [PHP] Deleting a file after download/upload

2009-06-23 Thread Daevid Vincent
 

 -Original Message-
 From: Parham Doustdar [mailto:parha...@gmail.com] 
 Sent: Tuesday, June 23, 2009 12:33 PM
 To: php-general@lists.php.net
 Subject: [PHP] Deleting a file after download/upload
 
 My server connects to an FTP. Then, it downloads a file from 
 the FTP, and then sends me the link to that temperary file on 
 the server. Now, when I download it from my server, my script 
 should delete the file. How can I make it wait until the 
 download of the file is finished?

# sudo crontab -e

Append this to the end...

15 * * * * root find /tmp/downloads -mtime +5 -type f -exec rm -rf {} \;


That will run every 15 minutes and purge anything in /tmp/downloads that is
over 5 days old


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Deleting 1 file line

2001-05-16 Thread Tarrant Costelloe

Does anyone know what the code is, if you wanted to specify a specific line
in a file to delete and also to wipe clean the entire file?

Thanks in advance!

Taz

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Deleting 1 file line

2001-05-16 Thread elias

Good question.
Never had to face such problems before...
but what I can do actually is:
1) Read file into variable till i reach that line
2) Skip that line
3) Continue reading till eof
4) writting back the buffer to the file.

Basically use file() then preg_replace() then fopen() fwrite() fclose()

-Elias
http://www.eassoft.cjb.net

Tarrant Costelloe [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Does anyone know what the code is, if you wanted to specify a specific
line
 in a file to delete and also to wipe clean the entire file?

 Thanks in advance!

 Taz

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] deleting a file

2001-05-16 Thread Joseph Bannon

What is the file function to remove/delete a file from a server?

Joseph


Say I'm Hot! - Post Your Picture!
http://www.sayimhot.com

















-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] deleting a file

2001-05-16 Thread Johnson, Kirk

http://www.php.net/manual/en/function.unlink.php

Kirk

 -Original Message-
 From: Joseph Bannon [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, May 16, 2001 1:53 PM
 To: PHP (E-mail)
 Subject: [PHP] deleting a file
 
 
 What is the file function to remove/delete a file from a server?
 
 Joseph

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] deleting a file

2001-05-16 Thread scott [gts]

read the docs you'll find your answer there.

php.net/delete

;)


 -Original Message-
 From: Joseph Bannon [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, May 16, 2001 3:53 PM
 To: PHP (E-mail)
 Subject: [PHP] deleting a file
 
 
 What is the file function to remove/delete a file from a server?
 
 Joseph
 
 
 Say I'm Hot! - Post Your Picture!
 http://www.sayimhot.com
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]