WordPress File upload and download problems solved

Source: Internet
Author: User
Tags wordpress blog

Some methods have been circulated on the Internet to modify the WordPress File upload size limit, most of which are a single version, and are not accurate enough, especially for the guidance of new users, this article summarizes the restrictions on uploading and downloading files by Wordpress blog users, as well as some problems and solutions to file upload failures.

I. File upload size limit

The most effective method is to modify the PHP configuration to adjust the limit.
To limit the upload size to 80 Mb, add the following code to the PHP configuration:

 

file_uploads =Onupload_max_filesize =80Mpost_max_size =80M

 

Modify the supported php versions for different hosts: Modify the php. ini file for PHP4 and php5.ini file for PHP5.

Ii. Check whether the file upload size limit takes effect

There are two methods. The first one is recommended.

1) edit the phpinfo. php file and upload it to the root directory of the server. The content is:

 

<?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://s6.hk/phpinfo.php

After completing the first step, you may need to wait for a period of time for the configuration to take effect, in half a few minutes to an hour.

2) refresh your wordpress background and go to the multimedia upload page. You will find that the size of the uploaded file has changed to the size you set.

Iii. invalid file type

Modify the wordpress/wp-uplodes/functions. php file and add the following two lines to get_allowed_mime_types:

 

'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. The solution is to add the following content to the. htaccess file:

 

AddType application/x-gzip .gz AddType application/octet-stream .7zAddType 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 one is created and uploaded to the server. Set the permission to 777.
 

Tip: when modifying the corresponding file according to this article, you must first check whether there are related configurations. If so, modify the file and add the file if not.

You are welcome to repost and retain the copyright. The address of this article is:

Http://www.cnblogs.com/s6cn/p/3487788.html

Http://s6.hk/archives/wordpress_update_solution/

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.