need file name for filesize()

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ebookers
Forum Newbie
Posts: 1
Joined: Thu Jul 23, 2009 9:43 am

need file name for filesize()

Post by ebookers »

Hi,

I'm using fread() PHP methods so I gotta use the filesize() method.
But this method works only with a file name (zeze.html, popo.txt, titi.xml, etc...)

The problem is that I have to fread() content on a webpage who is in url rewriting format (default display of apache server)
EXEMPLE IMG HERE : http://translator.ebookers/folder_server.gif
the url is written this way (http://www.site.com/folder/folder/folder/)
And has no file at the end.

Do you know :
1 > If there s a file by default on Apache folders presentation (that I can add at the end) http://translator.ebookers/folder_server.gif ?
2 > Or If I can use filesize() differently
3 > if ther is other ways to get http streams

Merci,
Sylvain.
User avatar
andyhoneycutt
Forum Contributor
Posts: 468
Joined: Wed Aug 27, 2008 10:02 am
Location: Idaho Falls

Re: need file name for filesize()

Post by andyhoneycutt »

If you're just scraping the data, you could use

Code: Select all

$data = file_get_contents("http://location.of.webpage");
-Andy
Post Reply