PHP FTP File Downloads

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ogaizu
Forum Newbie
Posts: 4
Joined: Wed Mar 24, 2010 4:48 pm

PHP FTP File Downloads

Post 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?
ogaizu
Forum Newbie
Posts: 4
Joined: Wed Mar 24, 2010 4:48 pm

Re: PHP FTP File Downloads

Post 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.
Post Reply