ftp_put

Discussion in 'PHP' started by gigamike, Dec 2, 2006.

  1. #1
    Hi Guys,

    Please help me with this. I used FTP_PUT but it always return a value of false. The FTP connection works fine.

    $conn_id = ftp_connect($ftp_server) or die("Couldn't connect to $ftp_server");

    if(!ftp_login($conn_id, $ftp_user, $ftp_pass)) {
    echo "Couldn't connect as $ftp_user\n";
    }

    $remote_file="text.txt";
    $file="text.txt";
    if(!ftp_fput($conn_id, $remote_file, $file, FTP_ASCII)) {
    echo "There was a problem while uploading ".$remote_file;
    }


    note: The $remote_file exist. i set the script to a linux box and im going to ftp_put to a windows server. I created an ftp account in windows via filezilla. Did i miss something.

    Thanks,

    mike
     
    gigamike, Dec 2, 2006 IP
  2. T0PS3O

    T0PS3O Feel Good PLC

    Messages:
    13,219
    Likes Received:
    777
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Does the FTP user have write permissions?
     
    T0PS3O, Dec 2, 2006 IP
  3. gigamike

    gigamike Active Member

    Messages:
    165
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #3
    Hi Sir,

    thanks for the immediate reply.I think yes (Please not that im ftput wherein the file to be remoted is on linux and i will copy i to windows) the chmod in windows when im doing an FTP is 0755. Is this the write permission youre askin.

    Thanks again,


    mike


     
    gigamike, Dec 2, 2006 IP