...

View Full Version : uploading remote http file to ftp



Extreme43
02-09-2006, 02:52 AM
Hey,
How can i upload a file from say. "http://mydomain.com/image.jpg" to ftp

Using the code below doesnt seem to work
NOTE: yes i know 192.168.0.1 is the local ip address. heh



$ftp = ftp_connect("192.168.0.1");
$login = ftp_login($ftp, "upgrade", "upgrade");
ftp_pasv($ftp, true);
if (ftp_put($ftp, "http://192.168.0.1/files/images/logo.jpg", "images/logo.jpg", FTP_ASCII) )
{
echo "uploaded";
}else{

echo "failed";
}


i checked ftp log and it doesnt seem to attempt the upload


(000189) 9/02/2006 1:43:04 PM - upgrades (192.168.0.1) > 230 User upgrades logged in.
(000189) 9/02/2006 1:43:04 PM - upgrades (192.168.0.1) > PASV
(000189) 9/02/2006 1:43:04 PM - upgrades (192.168.0.1) > 227 Entering Passive Mode (220,233,71,51,0,21).
(000189) 9/02/2006 1:43:04 PM - upgrades (192.168.0.1) > disconnected. (00:00:00)

Extreme43
02-10-2006, 10:10 AM
Bump...



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum