#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2000
    Posts
    33
    Rep Power
    15
    I'm trying to upload a file on my local
    computer to the server.

    i know the script is allright, i also
    tried to rename files and that worked

    but i can't upload a file from my local harddisk d: to the server

    here's the script i use :
    <?

    $server = '*******'; //changed for this example
    $user = '*****'; //changed for this example
    $pass = '******'; //changed for this example

    $source_file = 'd:background.gif';
    $destination_file = '/opt/guide/www.mydomain.nl/HTML/images/testbackground.gif';

    $ftp_connect = ftp_connect ($server)
    or die ("Could not connect to $server");

    $ftp = ftp_login ($ftp_connect, $user, $pass)
    or die ("Authentication failed");

    $result=ftp_put ($ftp, "$destination_file", $source_file, FTP_BINARY);

    if ($result)
    print "file uploaded";
    else
    print "Not uploaded";

    ftp_quit ($ftp);

    ?>

    i keep getting the error message :
    Warning: error opening d:background.gif in /opt/guide/www.egifts.nl/HTML/testrename.php3 on line 20


    What am i doing wrong ????

    Thanks for your help !

    Jan, The Netherlands.
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2001
    Posts
    1
    Rep Power
    0
    Pretty old message. But I miss the answer - since I have the same problem. Although my local file path is "c:/test.txt". The same error message. I tried "c://test.txt" and also "c:\test.txt", but with no effect.
    Thanks for advice.

Similar Threads

  1. Replies: 1
    Last Post: February 8th, 2004, 01:59 PM
  2. PHP file upload script trouble
    By casbboy in forum PHP Development
    Replies: 9
    Last Post: February 5th, 2004, 07:42 PM
  3. how to upload text file into blob field
    By misoz in forum MySQL Help
    Replies: 8
    Last Post: February 5th, 2004, 02:48 AM
  4. php-sql file upload and download
    By mthroesch in forum PHP Development
    Replies: 0
    Last Post: January 28th, 2004, 01:56 AM
  5. Local file
    By csengyee in forum Java Help
    Replies: 2
    Last Post: January 17th, 2004, 03:27 AM

IMN logo majestic logo threadwatch logo seochat tools logo