Page 1 of 1

PHP FTP File Downloads

Posted: Wed Mar 24, 2010 4:56 pm
by ogaizu
Pls help. I got this warning errors

Warning: "ftp_get(RegistrationForm.pdf) [function.ftp-get]: failed to open stream: Permission denied in /home/commodit/public_html/download_register.php on line 25

Warning: ftp_get() [function.ftp-get]: Error opening RegistrationForm.pdf in /home/commodit/public_html/download_register.php on line 25"


trying to download a file from an FTP Server. What did I do wrong?

Re: PHP FTP File Downloads

Posted: Wed Mar 24, 2010 9:16 pm
by ogaizu
Lines 25 - 28 of the code are as follows

if (ftp_get($conn_id, $local_file, $server_file, FTP_BINARY)) {
echo "Successfully written to $local_file\n";
} else {
echo "There was a problem\n";
}

The file I'm attempting to download is a pdf file.