I developed a file upload sharing website and used the following code to implement the file upload function:
Copy codeThe Code is as follows:
<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>
When a File with a slightly larger size is found during actual execution, the File couldn't be moved is displayed.
The file name is displayed in the database, but the size is not displayed.
When a file larger than 8 Mb is uploaded, the page does not respond.