#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2001
    Location
    London
    Posts
    2
    Rep Power
    0

    FTP with PHP problem


    Hi,

    Im having a problem using the FTP commands within a simple script. All i want to do is upload a text file (test.txt) to my remote PHP server, and i cant seem to get it to work.

    Here is the script im using, and it errors on the Upload line.

    Do I have to state the directory of the file to send? Since its just on c:\?

    Any help would be much appreciated.

    Regards, Ben.

    <?

    // connect to FTP server
    $conn = ftp_connect("hostname.com");

    // log in with username and password
    ftp_login($conn, "username", "password");


    // upload
    ftp_put($conn, "test.text","test.txt", FTP_ASCII);


    // close connection
    ftp_quit($conn);

    ?>
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2001
    Location
    London
    Posts
    2
    Rep Power
    0

    correction


    Sorry, theres a typo in the upload line, but it still does not work.

    It should be:-

    // upload
    ftp_put($conn, "test.txt","test.txt", FTP_ASCII);

    Ben.

IMN logo majestic logo threadwatch logo seochat tools logo