I checked lua_request.c and the filename was being pulled out of the
Content-Disposition header, but not added to the lua table, so I added the
lines below at about 389, and it seems to work now (ie the result of
r:parsebody() returns the correct/expected value for the key 'filename'):

if (strlen(filename)) {
    req_aprtable2luatable_cb_len(L, "filename", filename, strlen(filename));
}

On Sat, Jul 9, 2016 at 10:26 PM, Mark Taylor <mtt...@gmail.com> wrote:

> Hi,
>
> I'm using mod_lua and doing file upload. Works fine, except I can't figure
> out how to get the filename. I tried getting the header directly but it
> doesn't seem to be in headers_in, ie this returns nil:
>
> r.headers_in['Content-Disposition']
>
> Content-Disposition: form-data; name="file_upload"; filename="a.txt"
>
> Seems like only name="" available from the parsebody()? Is there a way to
> get the filename for the uploaded file?
>
> Thanks,
>
> Mark
>

Reply via email to