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 |