Re: fopen wierdness
| From: | Plutarck | Date: | Fri, 06 Apr 2001 01:12:41 +0000 |
| Subject: | Re: fopen wierdness | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-47367@lists.php.net to get a copy of this message | ||
Technically yes.
In an HTTP session, the server returns a header "Content-length" which lists
the more or less exact size of the file being sent.
But there isn't really an easy way of reading HTTP headers in php, yet. I
really wish there were.
You can use fsockopen to make your own http session, and you may be able to
use the CURL functions. But I really haven't a clue how, as I haven't yet
had the time to play with them much.
Maybe if it works, that's an easy way to do it...
--
Plutarck
Should be working on something...
...but forgot what it was.
"Jerry" <bonnej@Prairie.lakes.com> wrote in message
news:Pine.LNX.4.21.0104051949450.15206-100000@Prairie.lakes.com...
> acutally i found my problem, what was happening was that script1 that was
> on the server that file resides had that file open at the same time that
> scirpt2 was trying to open via http, when i change that files name, the
> permissions changed, and script1 was unable to open the file, and so
> script2 was able to :p my bad.
>
> but it leads me to another question, is there a way to get the file size
> of something opened via httpd?
>
>
> Jerry Bonner
> Systems Analyst / Web Development
> ---------------------------------
> email: [bonnej@prairie.lakes.com]
> icq : [34572902]
> phone: [507.344.1514]
> fax : [507.385.6017]
> ---------------------------------
> Prairie Lakes Internet
>
> On Thu, 5 Apr 2001, Steve Werby wrote:
>
> > "Jerry" <bonnej@Prairie.lakes.com> wrote:
> > > im trying to fopen a url with something like to following :
> > >
> > > fopen("something.com/something.txt", r);
> > >
> > > this returns a "0"
> >
> > If you're trying to open an external file make sure you prepend the URL
with
> > 'http://'. If that's a local file and
> > it's not finding the file, make
sure
> > the path is correct.
> >
> > > now when i rename the doc to something.htm, ill get the contents?
> >
> > Which document - the one being called by fopen() or the one containing
the
> > PHP script?
> >
> > --
> > Steve Werby
> > President, Befriend Internet Services LLC
> > http://www.befriend.com/
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>