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
>
<?
php
print_r($_REQUEST);
?>
<
h2
>Select files to upload</
h2
>
<
form
enctype
=
‘multipart/form-data‘
action
=
‘/upload_waynerqiu?who=abc&she=def‘
method
=
‘post‘
>
<
input
type
=
‘file‘
name
=
‘file1‘
><
br
>
<
input
type
=
‘submit‘
name
=
‘submit‘
value
=
‘Upload‘
>
<
input
type
=
‘hidden‘
name
=
‘test‘
value
=
‘value‘
>
</
form
>
<
a
href
=
‘/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