WordPress file upload and download problems solved

Source: Internet
Author: User
Tags file upload ini php file phpinfo rar

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.