Files
resty_functions/scripts/upload_combined_image.lua
T
2022-06-26 17:49:50 +08:00

14 lines
575 B
Lua

package.path = package.path .. ';<SCRIPT_PATH>/?.lua';
ngx.log(ngx.INFO, 'UPLOAD COMBINED IMAGE -> start')
local upyun_upload = require("upyun_upload")
ngx.log(ngx.INFO, 'UPLOAD COMBINED IMAGE -> upyun_upload loaded')
local file_to_upload = string.match(ngx.var.request_uri, ".*/(.*)")
ngx.log(ngx.INFO, 'UPLOAD COMBINED IMAGE -> file to upload -> ', file_to_upload)
local file_dir = ngx.var.tmp_file_dir
local fullpath = file_dir .. "/" .. file_to_upload .. ".jpeg";
ngx.log(ngx.INFO, 'UPLOAD COMBINED IMAGE -> fullpath -> ', fullpath)
upyun_upload.upload(fullpath, nil)