You are here: Re: FTP upload failed « All PHP « IT news, forums, messages
Re: FTP upload failed

Posted by J.O. Aho on 05/27/07 11:46

Zoe Brown wrote:
> I have the following simple script. But I am getting the error message "FTP
> upload failed!" Which is annoying. Why might this be ?
>
> the files i have tried are tiny .txt and jpeg.

> $upload = ftp_put($conn_id, $file, $file, FTP_ASCII);
>
> // check upload status
> if (!$upload)
> {
//if you aren't going to use the $upload value, then you can use
//if(!ftp_put($conn_id, $file, $file, FTP_ASCII)) {
//instead of if (!$upload) {
> echo "FTP upload has failed!<br>";
> }
> else
> {
> echo "Uploaded $source_file to $ftp_server as $file<br>";
//no point in setting $upload to true, it's already true or
//else you would have got the "FTP upload has failed!" message
> $upload = True;
> }

It could be so that the directory whereto you come when you login to the ftp
server isn't writable for the user as you are logged in, you may have to
change to an upload directory (use ftp_chdir()).



--

//Aho

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация