I. File upload size limit
Modify the PHP configuration to adjust the limits.
To limit the upload size to 18 MB, add the following code to the PHP configuration:
The code is as follows: |
Copy code |
File_uploads = On Upload_max_filesize = 18 M Post_max_size = 18 M
|
For the Goddy host, the file upload size is limited to 8 MB by default and needs to be modified in php.
PHP4 modifies the php. Ini file, and PHP5 modifies the php5.ini file.
II. Check whether the file upload size limit takes effect
Edit the phpinfo. Php file and upload it to the root directory of the server. The content is:
The code is as follows: |
Copy code |
<? Php phpinfo ()?>
|
In this way, you can access phpinfo. php to check whether the PHP configuration modification is modified.
Such as the site access address: http://chen-w.com/phpinfo.php
The Goddy host needs to wait for a period of time for the configuration to take effect, in half a few minutes to an hour.
III. Invalid file type
Modify the wordpress/wp-uplodes/functions. Php file,
Add the following two rows to get_allowed_mime_types:
The code is as follows: |
Copy code |
'7z' => 'application/x-7z-compressed ', 'Rar '=> 'application/x-rar-compressed ',
|
In addition, consider adding the 7z type to archive by using the wp_ext2type () method.
4. Files cannot be downloaded
Free Goddy hosts automatically implant ads on each page. This also causes the uploaded files to be unable to be downloaded.
Solution: add the following content to the. htaccess file:
The code is as follows: |
Copy code |
AddType application/x-gzip. gz AddType application/octet-stream. 7z AddType application/octet-stream. zip AddType application/octet-stream. rar AddType application/octet-stream. msi AddType application/octet-stream. exe
|
If the. htaccess file does not exist in the root directory, a new file is created and uploaded to the server. Set the permission to 777.
We recommend an upload/download plug-in.
WP Easy Uploader-WordPress file Upload plugin
This is an enhanced WordPress file Upload plug-in that supports direct network file capturing. The formats supported for online file extraction include: zip,
Tar, gz, tar.gz, tgz, tar.bz2, and tbz.
WordPress file download management plug-in
The WordPress file download plug-in does not belong to the WP-DownLoadManager plug-in. This plug-in can be said to be powerful, it can
Add Local files and remote files, and customize the path of local files on the server. You can modify the template parameters displayed on the foreground.