Web Hosting Talk







View Full Version : size


annoying
10-27-2004, 07:00 PM
i got a problem.

i am using the max file size in a form and i cant get it so u can only upload like a meg or 2

it wont block out anyfiles

can someone help me

<input type="hidden" name="MAX_FILE_SIZE" value="10000000">

i used this but no sure what to set value to

kuprishuz
10-28-2004, 12:33 AM
u will not be able to set max_file_size via a form field, it has to be done server side, and with that said i wouldnt recommend setting the value the server side uses in a form field either , being u could save the form and modify it to what value u wanted therefor defeating the purpose.

u cannot prevent the file from being uploaded entirely , it is always put in a temp directory but on the page that the for submits to use something like the following


$int_max_file_size = '2097152'; // Size in Bytes
if (filesize($str_temp_file_name) > $int_max_file_size) {
echo 'file size is too large';
} else {
move_uploaded_file($str_temp_file_name, $str_upload_dir . $str_file_name);
}