Re: file Upload - checking file size before uploading

From: Date: Thu, 11 May 2006 04:30:48 +0000
Subject: Re: file Upload - checking file size before uploading
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-235962@lists.php.net to get a copy of this message
True, but it checks it at the first attempt to upload, not when the file is done or partially uploaded. Granted, not what the OP asked for exactly, but better then what he has now and better then spending more time looking... Wolf Chris wrote: > Wolf wrote: >> In your form uploading script: >> # individual file size limit - in bytes (102400 bytes = 100KB) >> $file_size_ind = "838860800"; // 819.2 MB >> >> >> $weight=$_FILES[fileupload][size]; >> >> if ($weight>$file_size_ind) >> { >> echo"<br><img src=\"$dir_img/error.gif\" width=\"15\" >> height=\"15\">&nbsp;<b><font size=\"2\">ERROR: >> please get the file size >> less than ".$file_size_ind." BYTES (".round(($file_size_ind/1024),2)." >> KB)</font></b><br>»<a >> href=\"$_SERVER[PHP_SELF]\">back</a>"; >> } > > That has already attempted to upload the file to the server.. which is > what the OP didn't want. > > Would be handy to be able to do this but *shrug*.. >

« previous php.general (#235962) next »