Re: MAX_FILE_SIZE not working with file uploads

From: Date: Sun, 23 Sep 2007 04:33:01 +0000
Subject: Re: MAX_FILE_SIZE not working with file uploads
References: 1 2 3 4 5  Groups: php.general 
Request: Send a blank email to php-general+get-262382@lists.php.net to get a copy of this message
Jeff Cohan wrote:
Dan Parry wrote:
I might be wrong but this would be classed as 'exploitable'... Webservers should not be allowed to read from or write to clients... Of course there is ActiveX...
I think we're off the point. My script is simply interrogating the value of the $_FILES[userfile][size] array element. It's coming up as ZERO if it exceeds the MAX_FILE_SIZE. That seems odd to me. But maybe that's the way it's SUPPOSED to work. That's why I started this thread out with "What am I missing?". Said another way: It seems that the server had to know the size of the file in order to know it exceeded MAX_FILE_SIZE. So how can my script find out the size?
Not at all. The user-agent is built to ignore files that exceed the MAX_FILE_SIZE value. The hooks into the OS that it utilises to send the file to the server also allow it to poll the file size (if it couldn't, things would get messy on the server, quick). But Javascript is a whole 'nother thing, and it is not (normally--see Jim Lucas' post) able to get this information (thankfully). So, your PHP script is not receiving a file at all. brian

« previous php.general (#262382) next »