Files
resty_functions/scripts/upload_combined_image.lua
T

14 lines
570 B
Lua
Raw Normal View History

2022-03-08 21:59:25 +08:00
package.path = package.path .. ';<SCRIPT_PATH>/?.lua';
2022-05-29 23:43:57 +08:00
ngx.log(ngx.INFO, 'UPLOAD COMBINED IMAGE -> start')
2022-03-08 21:59:25 +08:00
local upyun_upload = require("upyun_upload")
2022-05-29 23:48:15 +08:00
ngx.log(ngx.INFO, 'UPLOAD COMBINED IMAGE -> upyun_upload loaded')
2022-03-08 21:59:25 +08:00
local file_to_upload = string.match(ngx.var.request_uri, ".*/(.*)")
2022-05-29 23:43:57 +08:00
ngx.log(ngx.INFO, 'UPLOAD COMBINED IMAGE -> file to upload -> ', file_to_upload)
2022-03-08 21:59:25 +08:00
local file_dir = ngx.var.tmp_file_dir
local fullpath = file_dir .. "/" .. file_to_upload .. ".jpeg";
2022-05-29 23:43:57 +08:00
ngx.log(ngx.INFO, 'UPLOAD COMBINED IMAGE -> fullpath -> ', fullpath)
2022-03-09 01:57:15 +08:00
2022-03-08 21:59:25 +08:00
upyun_upload.upload(fullpath)