Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Mar 2005
    Posts
    98
    Thanks
    0
    Thanked 0 Times in 0 Posts

    uploading remote http file to ftp

    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

    Code:
    $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
    Quote Originally Posted by FTP LOG
    (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)

  • #2
    New Coder
    Join Date
    Mar 2005
    Posts
    98
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Bump...


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •