How does php solve the problem of not uploading files larger than 8M
- 2021-01-22 04:55:15
- OfStack
Development of a file upload sharing website, once wanted to use the following code to achieve the function of file upload:
File couldn't be moved when uploading a slightly larger file is found during actual execution.
The database shows the name of the file, not the size.
When a file larger than 8M is uploaded, the page does not respond at all.
<form enctype="multipart/form-data" action="add_file.php" method="post">
<fieldset><legend>Fill out the form to upload a file:</legend>
<?php // Create the inputs.
for ($i = 0; $i < $counter; $i++) {
echo '<b>File:</b> <input type="file" name="upload' . $i . '" />
<b>Description:</b> <textarea name="description' . $i . '" cols="40" rows="5"></textarea>
';
}
?>
</fieldset>
<input type="hidden" name="submitted" value="TRUE" />
[align=center]<input type="submit" name="submit" value="Submit" />[/align]
</form>
File couldn't be moved when uploading a slightly larger file is found during actual execution.
The database shows the name of the file, not the size.
When a file larger than 8M is uploaded, the page does not respond at all.