Solve Nginx upload module Nginx_upload_module pass get parameters

Source: Internet
Author: User

Summary of methods to solve the nginx_upload_module of Nginx upload module passing get parameters

Recent users have reflected that our system can only upload files of 50M size, hoping to support uploading larger files.

Obviously PHP can not easily achieve large file upload, because there will be a variety of depressing problems, such as server timeouts, then how to solve it? I thought of nginx_upload_module!!!

How do I install nginx_upload_module? See here:nginx_upload_module installation using Tutorials

Solve the large file upload and encountered a new problem, we hope that through the Nginx_upload_module to the background PHP handler to get the data transfer (of course Nginx_upload_module Supports post data transfer, but does not support get)

Below i solve nginx_upload_module use Get to pass the method to publish, hope to be able to help the same as I need friends!

Modify Nginx configuration file (program site profile test.conf)

1234567 location /upload_waynerqiu{upload_pass_args on;upload_resumable on;upload_pass /up_test.php?$args;#此处省略掉详细配置…#如需要详细的参考可查看http://waynerqiu.com/7/136.html}

HTML form code (up_test.php, this page is also responsible for the Nginx_upload_module callback page as a form page)

1234567891011121314151617 <html><head><title>Test upload</title></head><body<?phpprint_r($_REQUEST);?><h2>Select files to upload</h2><formenctype=‘multipart/form-data‘action=‘/upload_waynerqiu?who=abc&she=def‘method=‘post‘><inputtype=‘file‘name=‘file1‘><br<inputtype=‘submit‘name=‘submit‘value=‘Upload‘><inputtype=‘hidden‘name=‘test‘value=‘value‘></form><ahref=‘/up_test.php‘>back</a></body></html>

From the above two generations we can see that I try to use /upload_waynerqiu?who=abc&she=def to pass who=abc&she=def to the background Nginx callback program up_test.php, In this process I used the Nginx variable $args (see here for more Nginx variables: http://waynerqiu.com/7/138.html).

After testing, we found that the parameters can be passed perfectly!

The Red line part is the parameter passed with Nginx_upload_module!

Solve Nginx upload module Nginx_upload_module pass get parameters

Related Article

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.