I'm using the following code to upload a user-specified file (of image, audio or video filetype) to a server that is remote to the one that hosts the script.
Code: Select all
ftp_pasv($ftpConn,true);
$ftp = ftp_chdir($ftpConn,$ftp->userFilePath.'/'.$fileType) or die(error::errorReport('changeDirFail'));
$ftp = ftp_nb_put($ftpConn,$fileName,$configs['mediaserver'].$_SESSION['pcu_username'].'/'.$fileType,FTP_BINARY) or die(error::errorReport('fileFTPFail'));
while ($ftp == FTP_MOREDATA) {
$ftp = ftp_nb_continue($ftpConn);
}
if ($ftp != FTP_FINISHED) {
echo _FTP_FAIL_ ;
exit(1);
}
$ftp = ftp_close($ftpConn);
if($ftp) echo "transfer complete";Can anyone suggest why this may be happening and what can be done to fix it?
Many thanks,
Matt