File Errors

[php]<?php
$link=ftp_connect(“ftp.freepgs.com”);
ftp_login($link,“h2oswimminguy500”,"*******");
ftp_chdir($link,"/UncleJohn/Images/");
$list=ftp_nlist($link,".");
echo ftp_pwd($link);
echo “
”;
$info=ftp_rawlist($link,".");
foreach($info as $a){
echo $a;
echo “
”;
}
foreach($list as $file){
echo $file;
echo “
”;
echo filetype(“http://www.freepgs.com/h2oswimminguy500/UncleJohn/Images/”.$file);
echo “
”;
}
?>[/php]
This keeps on giving me the error:

Warning: lstat failed for http://www.freepgs.com/h2oswimminguy500 … 149805.jpg (errno=2 - No such file or directory) in /drive2/fpgshttpd/h2oswimminguy500/UncleJohn/add.php on line 31

But if you goto http://www.freepgs.com/h2oswimminguy500 … 149805.jpg The file clearly Exists…Does anyone have any insight in why this is happnening?[/php]

Drop the http://www.freepgs.com/ part of the file type. Probably also want to change the path to the ABSOLUTE path on the File system not the Webserver.

So your line should be more like

echo filetype("/drive2/fpgshttpd/h2oswimminguy500/UncleJohn/Images/".$file);

Sponsor our Newsletter | Privacy Policy | Terms of Service