- <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.
Several articles found on the Internet:
Solve the Problem of uploading large files in PHP
Php settings allow large file uploads
Upload large files using apache + php
Php. ini settings when uploading large files
All the above articles indicate that php File Upload is affected by the following settings of php. ini:
- Post_max_size
- Upload_max_filesize
- Max_execution_time
- Memory_limit
Find/etc/php5/apache2/, find php. ini, search for post_max_size, and change its default value to 125 M;
Search for upload_max_filesize, change its default value to 125 MB, and save the settings.
Enter apache2ctl-k restart on the terminal to restart apache. The problem is solved successfully.