lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Try request.POST.fileinput.contents. request.POST.fileinput.size has
the size of the payload in bytes.

--
Fabio Mascarenhas


On Tue, Jun 8, 2010 at 7:27 AM, ykhuang <ykhuang@gmail.com> wrote:
> Hi,
> I'm writing a file uploading Lua script but can't find the uploaded data
> when POSTing in multipart/form-data.
> If I post the data with content type 'application/x-www-form-urlencoded', I
> will find post data in request.POST.post_data. When I post
> in multipart/form-data, the data is not included in request.POST.post_data.
> The test pattern is done by curl in the form:
> curl -X POST -H "Expect:" -F "fileinput=@datafile;type=multipart/form-data"
> http://ipaddress/upload.lua
> Where 'fileinput' will be the field name of the form. I found the
> request.POST.fileinput['name'] will be the name of the file('datafile') but
> cannot find where the payload is.
> Please advise if somebody has the experience. Thanks.
> Regards
> YK