Re: scandir and ftp wrapper

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, April 12, 2007 9:07 am, John Ewing wrote:
> Still can't get it to work, seems to be a problem generally with the
> ftp
> wrapper.
>
> If I try something really basic like
>
> echo file_get_contents('ftp://user:pass@xxxxxxxxxxxxxxx/file.txt');
>
> I get an empty string with no error messages.
> If I copy and paste the ftp url string into firefox it displays the
> file, so
> the url is correct
>
> If I try this
>
> echo file_get_contents('http://www.google.com');
>
> I get the html displayed. I have been testing this code using the php
> cli if
> that makes any difference.
>
> Really could use some suggestions on this one

I can think of only one reason why your test might be invalid:

If you have already logged in to the FTP server from the browser, and
the user:pass in the URL aren't the ones actually authenticating you,
but the ones saved in the browser are the ones that let you in, you'd
get the behaviour you have described.

Seeems unlikely to be the cause, but quit the browser before your test
to be sure.

You may also want to consider using http://php.net/ftp as a
work-around, if this new-fangled FPT streams stuff just isn't working.

Or even http://php.net/curl for that matter.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux