大家好!
https://github.com/openresty/lua-resty-upload
示例代码如下:
if typ == "header" then
local file_name = my_get_file_name(res)
if file_name then
file = io.open(file_name, "w+")
if not file then
ngx.say("failed to open file ", file_name)
return
end
end
post文件时, header 有两个, 导致io.open 会调用两次, 而后面的 file:close()只调用了一次, 这样会不会有问题?