pgaertig / nginx-big-upload

Resumable and reliable file uploads of any size. Nginx extension written in Lua.
https://github.com/pgaertig/nginx-big-upload
Other
192 stars 49 forks source link

pass the initial params to final url #7

Open mapopa opened 11 years ago

mapopa commented 11 years ago

I need some params to be passed to the final url when the file uploading is finished

a config option like in nginix-upload-module upload_pass_form_field

mapopa commented 11 years ago

If upload_pass_form_field is set then I would get the list of args like args = ngx.req.get_post_args()

but i don't know how to pass it to end_backend in ctx

pgaertig commented 11 years ago

Generally with RAW POST upload there is no way to attach data to payload other than use URL query params or custom HTTP headers. For sure you can introduce your own HTTP header, i.e. X-My-File-Metadata, and that header will be passed up to back-end. I haven't tested URL query params yet. Try to concat $query_string to backend_url and let us know about your results.

pgaertig commented 11 years ago

And of course you can pass params using URL path i.e. /files/23123/abc/def then you can use location statement with regular expression to extract what you need and build backend_url using these matches.