I took the scriopt from php manual and adapted it to my needs, but I get
an error:
Warning: ftp_put(): user_pictures/vic/: No such file or directory in
/home/victor/argilent-www/sites/kodak/upload_picture.php on line 103
This is the code:
# set up basic connection
$conn_id = ftp_connect($ftp_server);
# login with username and password
$login_result = ftp_login($conn_id, $ftp_user, $ftp_pass);
# check connection
if ((!$conn_id) || (!$login_result)) {
echo 'FTP connection has failed.';
exit;
}
$destination = $picture_location.'/'.$f_username.'/';
# upload the file
$upload = ftp_put($conn_id, $destination, $picture, FTP_BINARY);
# check upload status
if (!$upload) {
echo 'FTP upload has failed.';
}
# close the FTP stream
ftp_close($conn_id);
I added the destination variable so that I can easily edit the
destination if I sweitch servers, I'm guessing the error occurs because
php doesn't know where to take the file from?! I'm guessing here, but it
would be nice if someone tough me a bit more about ftp with php.
user_pictures/vic is the directory the $picture has to go in, but I
dunno why it doesn't work.
- Victor > www.argilent.com
______________________________________________________________________
Post your free ad now! http://personals.yahoo.ca
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php