nginx-lua and nginx upload module

agentzh agentzh at gmail.com
Sat Nov 26 08:08:05 UTC 2011


On Sat, Nov 26, 2011 at 3:36 PM, strawman <nginx-forum at nginx.us> wrote:
> Hi all,
>
> I'm hoping to write an nginx-lua script which handles file uploads from
> the nginx upload module.  I can do this fine using an external backend
> and the upload_pass directive, but the lua module has no functionality
> for parsing the multipart form data that this generates.  I've also
> tried accessing the $upload_file_name, $upload_tmp_path etc. variables
> generated by the upload module directly, but I don't seem to be able to
> access these outside of the upload_set_form_field directive.
>

Well, there will be a streaming request body reading API for ngx_lua
soon. For instance:

    local data, err = ngx.req.recv_body_data()

Atop this, we can easily build a multipart streaming parser in pure
Lua and no longer rely on the ngx_upload module to read and process
the request body. (The UI of ngx_upload is not so friendly for Lua
scripting and it'll be technically difficult to make them work
together without lots of line noises.)

Someone is already willing to sponsor this work but I'm too busy to
implement this lately :P

Regards,
-agentzh



More information about the nginx mailing list