Hello list,

Simple Enough Objective: store file remotely (wu-ftp);
MinorSnag: PHP's ftp-functions unavailable at localhost;
BelowWorkaround: works fine for deleting remote file;
MajorSnag: how to STORE a file remotely using socket?

<?php
$ftp=fsockopen("ftp.server.com", 21, $errno, $errstr, 60);
if (!$ftp) {
 echo "Connection failed: $errstr ($errno)";
 exit;
}
else {
 socket_set_blocking($ftp, true);
 echo fgets($ftp,255);
 fputs($ftp,"USER ftp_username\r\n");
 echo fgets($ftp,255);
 fputs($ftp,"PASS ftp_passw\r\n");
 echo fgets($ftp,255);
 fputs($ftp,"DELE /home/httpd/html/test.htm\r\n");
 echo fgets($ftp,255);
 fputs($ftp,"QUIT\r\n");
 echo fgets($ftp,255);
 fclose($ftp);
}
?>

BTW: I also messed with fopen("ftp://user:pass@...";) but failed
miserably (although it seemed possible before my mind wandered off).

ANY HELP IS APPRECIATED (using socket, fopen, ...)
--
[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]

Reply via email to