Maybe I should be more specific about what I am trying to do. I may be way 
off base in my approach.

I want to upload using ftp a file from my local c drive (c:\somefile.text) 
to my server. I have been trying the ftp_put function example in the manual 
and it is failing. It reports "There was a problem uploading the file."

Any suggestions would be greatly appreciated.

Thanks,
Julian
"Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Julian wrote:
>> Hello,
>>
>> I need to use FTP to upload a local file to a server. The uploads must be 
>> done through FTP and not HTTP. Unfortunately, the example in the manual 
>> is not working for me. If someone has any suggestions I would really 
>> appreciate it.
>
> Not much information. There is not error checking in the example, try this 
> and tell us the output:
>
> $file = 'somefile.txt';
> $remote_file = 'readme.txt';
>
> // set up basic connection
> $conn_id = ftp_connect($ftp_server);
>
> if(!$conn_id) die("Could not open connection to $ftp_server");
>
> // login with username and password
> $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
>
> if(!$login_result) die("Could not login as user $ftp_user_name");
>
> // upload a file
> if (ftp_put($conn_id, $remote_file, $file, FTP_ASCII)) {
>  echo "successfully uploaded $file\n";
> } else {
>  echo "There was a problem while uploading $file\n";
> }
>
> // close the connection
> ftp_close($conn_id); 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to