I'm having a problem with a script i have. All i want it to do is send 2 files via ftp to my server. Everything works fine except that it will only send the first 2820 bytes of data to the server, and when I do the chmod command, it says no such file or folder... here's my code:
<?php
// set up basic connection
$conn_id = ftp_connect("xxxx.xxxxxxxxxx.xxx");
// ftp_pasv($conn_id, 1);
// login with username and password
$login_result = ftp_login($conn_id, "xxxxxxxx", "xxxxxxxxxx");
// check connection
if ((!$conn_id) || (!$login_result)) {
echo "Ftp connection has failed!";
echo "Attempted to connect to Chemicatrion for user $user";
die;
} else {
echo "Connected to Chemicatrion, for user $user";
}
// upload the file
$upload = ftp_put($conn_id, "/public_html/" . $MyFile_name, $MyFile, FTP_BINARY);
// check upload status
if (!$upload) {
echo "Article upload has failed!";
} else {
$cmd = "chmod 777 " . $MyFile_name;
$site = ftp_site($conn_id, $cmd);
echo "Uploaded $MyFile_name to Chemicatrion.";
}
$upload = ftp_put($conn_id, "/public_html/" . $MyETC_name, $MyETC, FTP_BINARY);
// check upload status
if (!$upload) {
echo "Etc File upload has failed!";
} else {
echo "Uploaded $MyETC_name to Chemicatrion.";
}
// close the FTP stream
ftp_quit($conn_id);
?>
any help?