|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-01-10 15:06 UTC] epicanis+php at dogphilosophy dot net
One feature of PHP that I find REALLY handy is the transparent handling of 'remote' files (i.e. http:// and ftp:// URL's). Currently gzopen "doesn't quite" handle anything but local files. Attempting to gzopen, for example, an "ftp://some.host.net/pub/somefile.gz" URL currently returns a strange error (the error itself reported as Bug#14814). I traced a gzopen("ftp://some.host.net/pub/somefile.gz") sort of connection with ethereal, and noticed that connection to the ftp server IS made, login is performed, passive mode switched to, and the file is STARTED downloading (about 3 1k packets came across) but the script dies with a "Warning: Success in ...." error message. As I'm running the script from the command line as a standalone utility, I can instead do something like : wget -q ftp://some.host.net/pub/somefile.gz | php gzfilething.php > gzoutput.txt and gzopen("php://stdin") to process the text, and it does work fine, but it's a bit awkward to use and is inconsistent with fopen()'s behavior. Note that the fopen with "zlib:" URL's doesn't work for remote files, either (how would you write such a thing? fopen("zlib:ftp://some.host.net/pub/somefile.gz","r")? I tried several variations and confirmed that zlib: automatically assumes a local filehandle. Thanks! PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 12:00:01 2025 UTC |
You can do this in 4.3: fopen("compress.zlib://http://foobar.com"); It would be great if you could test RC2 and verify that this works. RC2 available from http://qa.php.net