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
//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
