音频转换及上传upyun
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user