ftp to a remote address data from post
| From: | Victor | Date: | Sun, 15 Sep 2002 02:25:14 +0000 |
| Subject: | ftp to a remote address data from post | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-116412@lists.php.net to get a copy of this message | ||
I am trying to get ftp working and it takes the data from post ok, but
the only way I got it to work is if it uploads to the root folder of my
web space provider. Any other attempt at describing a more accurate
address or remote address has failed.
This is the code that I use: (mostly straight from the php
documentation)
# set up basic connection
$conn_id = ftp_connect($ftp_server)
or die ('Could not establish FTP connection');
# login with username and password
$login_result = ftp_login($conn_id, $ftp_user, $ftp_pass)
or die ('Could not login');
# check connection
if ((!$conn_id) || (!$login_result)) {
echo 'FTP connection has failed.';
exit;
}
$destination = 'dummy/';
# upload the file
$upload = ftp_put($conn_id, $destination, $picture, FTP_BINARY);
# check upload status
if (!$upload) {
echo 'FTP upload has failed.';
exit;
}
- the above code is the one that uploads the file, but it puts it in the
root folder and it names it "dummy".
What am I doing wrong?
- Victor > www.argilent.com
______________________________________________________________________
Post your free ad now! http://personals.yahoo.ca