Re: Adding data to file via FTP

From: Date: Sat, 02 Dec 2000 05:43:41 +0000
Subject: Re: Adding data to file via FTP
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-28235@lists.php.net to get a copy of this message
Read the file in to PHP, add your stuff then re-upload (with overwrite) the file back to the server. I have not actually done this. Also you may not be able to send data to the FTP server in the way you are trying, I could be wrong but you are trying to treat a remote file as if it was local, the FTP server may not work that way. You may need the FTP function in PHP. Jay ----- Original Message ----- From: "Ville Mattila" <ville.mattila@pilotmedia.net> To: "PHP Talk" <php-general@lists.php.net> Sent: Friday, December 01, 2000 12:37 PM Subject: [PHP] Adding data to file via FTP Hi there, I tried to open a file via FTP for adding some data to the end of the file. The connect has been opened with fopen() -function. Here is the code strip: $f = fopen ("ftp://user:pass@ftp.pilotmedia.fi/$ftpdir/carts/$sesid.dat", "a+"); fputs ($f, time()."//".$prod."//".$amnt."//\n"); fclose($f); Why this doesn't work? PHP causes an error "Warning: fopen("ftp://...@ftp.pilotmedia.fi//shopdata/carts/b72986b7ab9fc3a707c7704bc 1c5addd.dat","a+") - File exists in /home/cust/n/e/nettipaa/www/psite/webshop/addtocart.php3 on line 27" Is there any way to open the file and write some data to the end of the file via FTP? Thanks, - Ville -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#28235) next »