need quick help

zimu

Diamond Member
Jun 15, 2001
6,209
0
0
i know wrong forum, but need this urgently-- FTP help with PHP. the following code stopped workign overnight, although the server is fine and when i try uploading something it creates the file but it is 0 bytes big and FTP has an error..






//FTP UPLOAD
$conn_id = ftp_connect("ftp.xxx.com");
//LOG IN
$login_result = ftp_login($conn_id, "(username)", "password");

$source_file = $_FILES['filename']['tmp_name'];
$destination_file = "/dest" . $_FILES['filename']['name'];
$titleofdoc = $_FILES['filename']['name'];

// upload the file
$upload = ftp_put($conn_id, $destination_file, $source_file, FTP_BINARY);

// check upload status
if (!$upload) {
echo "FTP upload has failed!";
} else {
echo "File Upload Successful";
}

// close the FTP stream
ftp_close($conn_id);

//END OF FTP UPLOAD
 

FoBoT

No Lifer
Apr 30, 2001
63,084
15
81
fobot.com
i don't know php, but it seems to me if the code was working, then stopped working, but the code didn't change, then it isn't the code that is broken

could permissions or the account credentials have changed?
 

zimu

Diamond Member
Jun 15, 2001
6,209
0
0
Originally posted by: FoBoT
i don't know php, but it seems to me if the code was working, then stopped working, but the code didn't change, then it isn't the code that is broken

could permissions or the account credentials have changed?

for some weird reason it started workign again when i enabled pasv transfers. something must have changed from the server side...