还可以加redis防止频繁请求
local upload = require "upload"
local method = ngx.var.request_method
if method ~='POST' then
ngx.say("method is not allowed")
return
end
local chunk_size = 4096
local form = upload:new(chunk_size)
local file
local filelen=0
if nil == form then
ngx.say("upload file is null")
return
end
form:set_timeout(0) -- 1 sec
local filename
function get_filename(