is_file and filesize functions

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
Kano
Forum Newbie
Posts: 3
Joined: Fri Nov 25, 2011 3:08 pm

is_file and filesize functions

Post by Kano »

Hello guys,

Just returned to PHP coding and found some problems in my old scripts on new Apache 2.2.21 and PHP 5.3.8 server.

is_file and filesize functions return either false or E_Warning on files: *.rar !

Is it server configuration problem or just file.rar is not file in PHP?

Thx for your time,
Kano
thinsoldier
Forum Contributor
Posts: 367
Joined: Fri Jul 20, 2007 11:29 am
Contact:

Re: is_file and filesize functions

Post by thinsoldier »

My guess is it's not php. is_file should be able to find any kind of file even if it has no file extension.
Warning: I have no idea what I'm talking about.
maxx99
Forum Contributor
Posts: 142
Joined: Mon Nov 21, 2011 3:40 am

Re: is_file and filesize functions

Post by maxx99 »

Whats the size of this file? I had a similar problem once while accessing big (>2GB) file.
Kano
Forum Newbie
Posts: 3
Joined: Fri Nov 25, 2011 3:08 pm

Re: is_file and filesize functions

Post by Kano »

Thanks for replies.

The size of file is not exceeding 500-600 MB in some cases, but usually its something like 20-30 MB. I've read something about big rar archive size problem, but I suppose it is not my case. And if it is not PHP functionality limitation I experience, then maybe it is about php.ini? It is not wrong path or such for sure, I checked another file in the same dir with same path except filname and for *.jpg file everything fine... I thought it might be some kind of security limitation for functions to not work with archives or do I need to write inside this type of files somewhere.
User avatar
McInfo
DevNet Resident
Posts: 1532
Joined: Wed Apr 01, 2009 1:31 pm

Re: is_file and filesize functions

Post by McInfo »

Kano wrote:is_file and filesize functions return either false or E_Warning on files: *.rar !
What is the text of the warning?
Kano
Forum Newbie
Posts: 3
Joined: Fri Nov 25, 2011 3:08 pm

Re: is_file and filesize functions

Post by Kano »

Here is the example of the error text:

Warning: filetype() [function.filetype]: Lstat failed for Airport.rar in X:\\PATH\\materials.php on line 261

Meanwhile will check google for solution, I might missed something during last search.
Post Reply