lua-resty-multipart-parser icon indicating copy to clipboard operation
lua-resty-multipart-parser copied to clipboard

Binary files do not work

Open vsguts opened this issue 7 years ago • 3 comments

When I try to upload binary file (jpg), I get error: failed to parse part: resty/multipart/parser.lua:58: bad argument #1 to 'find' (string expected, got nil).

When I try upload txt file, everything is ok.

vsguts avatar Mar 01 '18 17:03 vsguts

+1

weaponready avatar Dec 26 '19 09:12 weaponready

Try the latest OpenResty 1.15.8.2 version?

agentzh avatar Dec 26 '19 20:12 agentzh

Try setting client_body_buffer_size to some value greater than the size of your jpg file. It seems that ngx.req.get_body_data() cannot receive data beyond client_body_buffer_size. That's how I fixed the same error. @vsguts

Perhaps that's one thing @agentzh meant in his TODO section: Better error reporting. :)

anguslee avatar Mar 24 '20 09:03 anguslee