音频转换及上传upyun

This commit is contained in:
moicen
2022-01-28 02:25:18 +08:00
committed by 木逸辰
parent 862aff55da
commit 6f02e88c37
6 changed files with 54 additions and 51 deletions
+5 -3
View File
@@ -1,16 +1,18 @@
package.path = package.path .. ';/usr/local/openresty/nginx/scripts/?.lua';
local yun = require("upyun")
local cjson = require "cjson"
local function upyun_upload_file()
local config = {
user = "moicen", --授权操作员名称
passwd = "NyJ51zRwFApY9Wo9EHJMrb8GI9YtvpVN", --操作员密码
localFilePath = "/Users/liyong/Code/Lua/resty_functions/test_files_dir/r2d2.jpeg"
localFilePath = "/file_upload/abc.mp3"
}
local upyun = yun:new(config)
local savePath = "huiwing/test/r2d2.jpeg"
local savePath = "huiwing/test/abc.mp3"
local gmkerl = nil
local options = nil
@@ -19,7 +21,7 @@ local function upyun_upload_file()
ngx.say("failed to upload image file : " .. err)
return
else
ngx.say(info)
ngx.say(cjson.encode(info))
end
end