SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Evangelist dev_cw's Avatar
    Join Date
    Dec 2005
    Posts
    454
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    ftp_put error - Warning: ftp_put(): Opening ASCII...

    I have a ftp-put procedue that is working fine on my devcelopment server but fails to work on the clients server.

    This is what I have:
    PHP Code:
    $ftp_remote_file $fname_str;
    $ftp_local_file $fname_str;
    $ftp_c ftp_connect($ftp_host);
    ftp_login($ftp_c$username$password);
    ftp_put($ftp_c$ftp_remote_file$ftp_local_fileFTP_ASCII);
    ftp_close($ftp_c); 
    It is working great on my server but I receive this error on the clients server:
    Warning: ftp_put(): Opening ASCII mode data connection for...

    The FTP connection is working and a file is transfered with the correct file name but the file has 0k, in other words no data was transfered.

    The PHP script resides in the same directory as the file being transfered.

    Thanks.

  2. #2
    SitePoint Evangelist dev_cw's Avatar
    Join Date
    Dec 2005
    Posts
    454
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Follow-up:
    I was able to work it out by activating the ftp_pasv() mode and it work like a charm.

    PHP Code:
    // turn passive mode on
    ftp_pasv($conn_idtrue); 


Bookmarks

Posting Permissions

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