You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
localupload=require"resty.upload"localjson=require"cjson"locals3_upload=require"resty.s3_upload"localform, err=upload:new(chunk_size)
ifnotformthenngx.log(ngx.ERR, "failed to new upload: ", err)
ngx.exit(500)
endlocaltimeOut=10000form:set_timeout(timeOut)
whiletruedolocaltyp, res, err=form:read()
ifnottypthenngx.say(ngx.ERR,"failed to read: ", err)
returnendiftyp=="header" thencontent_type=res[2]
ifcontent_type=='application/hta' thenstart_upload=trueendngx.log(ngx.INFO,"content_type: ", content_type)
ngx.log(ngx.INFO,"header: ", json.encode(res))
elseiftyp=="body" thenifstart_upload==trueandresthenappender=appender..resendelseiftyp=="part_end" thenifappender~='' thenlocaldata_len=string_len(appender)
ngx.log(ngx.NOTICE,"start to upload ",content_type," len=" ,data_len)
##-- ERROR HERE handle string appender ##-- data_len is bigger than I expected when the chunk_size is 50*1024##-- data_len will bi right when I change the chunk_size as 10*1024 ##-- if I post a file in the form ##-- the data_len appender will be 15 byte bigger than the file I postedappender=''start_upload=falseendelseiftyp=="eof" thenbreakendend
The text was updated successfully, but these errors were encountered:
lilien1010
changed the title
form fead size bigger than the real data
form read size bigger than the real data length
Jan 27, 2016
@lilien1010 Please give more detailed explanation on what problem you are reporting and better, with steps of reproducing the problem on our side. Simply giving a code listing is not really helpful. Thanks for your cooperation.
here is the code
The text was updated successfully, but these errors were encountered: