Re: file upload size limits

From: Date: Thu, 15 Feb 2001 15:40:43 +0000
Subject: Re: file upload size limits
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-39917@lists.php.net to get a copy of this message
On Thu, 15 Feb 2001, Scott wrote: > I am uploading files and want to limit the size of the file. I can do this > as long as the file that I am uploading doesn't exceed the Server limit. We > don't own the server so I can't change any configuration on the server. > > Is there a way to Catch the warning and display my own message in the > browser. > > The Warning that I am getting is > > Warning: Max file size of 2097152 bytes exceeded - file [upfile] not saved > in [no active file] on line 0 You could control filesize within the HTML form. <input type="hidden" name="MAX_FILE_SIZE" value="(insert size)" /> This means that PHP will automatically reject files over the specified size. As far as I know, I'm not sure you will be able to catch the exceeded file error before it is passed back to the client, so customising the error might be out of the question. Also, I doubt you would be able to perform any kind of action that would determine the entire size of the uploading file prior to the upload being completed - if there was a way to catch this, then you would be able to redirect to an error page at the beginning of the upload, thus meaning that there would be no time wasted on the user's behalf. :) Cheers, Nicky W.. -[ pioneer@dac.org ]-

« previous php.general (#39917) next »