|
Posted by laredotornado on 11/14/06 01:20
Hi,
I'm using PHP 4.4.4 with Apahce 2.2 on Fedora Core 5 Linux. I'm having
trouble figuring out why an ftp_put call is failing. Is there a way I
can get an exact reason other than checking whether it has succeeded or
failed?
Here is my code
$conn_id = ftp_connect($ftp_host);
if ($conn_id) {
// login with username and password
$login_result = ftp_login($conn_id,
$ftp_user, $ftp_pwd);
if ($login_result) {
// Disable passive mode
ftp_pasv($conn_id, false);
// upload the file
$remote_path = "$ftp_dir/" .
SQL_PRODUCT_SHORT_FILE_NAME;
$upload = ftp_put($conn_id,
$remote_path, $sql_file_path, FTP_ASCII);
// check upload status
if (!$upload) {
die("FTP upload has
failed!");
I'm getting the message "FTP upload has failed" indicating things have
died. Still don't know why.
Thanks, - Dave
Navigation:
[Reply to this message]
|