Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Decent remote filesize option

Status
Not open for further replies.

kasuals

Programmer
Apr 28, 2002
100
US
I have gone over my options, and thus far have not found an option for snagging the remote filesize of a webpage. I can grab google.com, but anything that needs to be processed (ie php) comes back as 0 bytes.

I need to find the size of a file for hourly checksums, and hopefully someone can give me an idea of which way to go with this.

Thanks in advance.

- "Delightfully confusing..." raves The New York Times

-kas
 
It's hard to comment without knowing what you've already tried.

You can use PHP's cURL functions to fetch a webpage into a variable. Once the page is fetched, the function curl_getinfo() can tell you all kinds of interesting things about the page and your connection to it.

You could use file_get_contents() with a URL to fetch the page and store it in a string. Then use PHP's string functions to see the size of what is sent.



Want the best answers? Ask the best questions!

TANSTAAFL!!
 
I've tried busting the size out of the headers, which only really works for images and static content.

I think I'll give the file_get_contents(), and give that a shot.

Thanks as always sleip, you always come through for me. Even if it doesn't work out, I appreciate your response. You've pulled me out of alot of writers-blocks. =]

- "Delightfully confusing..." raves The New York Times

-kas
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top