Website space cannot use swfupload to upload files solution

Source: Internet
Author: User
Tags error code file upload

Using swfupload to upload the $ _ FILES variable is always blank

Today, we use HiChina's M3 virtual host, linux system, and apache server. After a program tested locally and other servers is uploaded to the HiChina M3 host, the system prompts that the file cannot be uploaded. After debugging, it is found that the $ _ FILES variable required for file uploading is always blank, therefore, you cannot upload images.

Solution:


After constantly searching on the M3 control panel, we found the php. ini settings page:

The default file Upload switch is disabled. Choose open> submit> to wait for 5 minutes. Upload successful...

By the way, this M3 host does not support pathinfo.


Other solutions to swfupload errors

1. Check whether the uploaded domain name is consistent with the flash domain name, and there may be cross-origin problems.

2. The uploaded background page has permission verification, which may cause a 302 error. Because swfupload upload is a new process enabled, you must manually pass the current sessionid to the background.

The code is as follows: Copy code

1 post_params: {"PHPSESSID": "<? Php echo session_id ();?> "}

Background Use

The code is as follows: Copy code

If (isset ($ _ POST ['phpsessid ']) {
Session_id ($ _ POST ['phpsessid']);
}

3. When the server is nginx, swfupload prompts the Error code #2038 or Upload Error: 413. The solution modifies the http segment of nginx. conf. If this line does not exist, add
Client_max_body_size 100 m;
The result is as follows:

The code is as follows: Copy code

Http
{
... Omitted here
Client_max_body_size 100 m;
... Omitted here
}
/Etc/init. d/nginx restart

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.