Clean project
This commit is contained in:
@@ -19,27 +19,9 @@ function upyun_remove.remove(filepath, filename, retry)
|
|||||||
ngx.log(ngx.ERR, "failed to remove file : reach max retries")
|
ngx.log(ngx.ERR, "failed to remove file : reach max retries")
|
||||||
else
|
else
|
||||||
|
|
||||||
---- 使用 os.tmpname 获取临时文件名
|
|
||||||
--local tempFileName = "upyun_remove_temp_file"
|
|
||||||
---- 拼接路径
|
|
||||||
--local tempFilePath = "/tmp/" .. tempFileName
|
|
||||||
---- 使用 io.open 创建临时文件
|
|
||||||
--local tempFile = io.open(tempFilePath, "w")
|
|
||||||
---- 写入内容到临时文件
|
|
||||||
--tempFile:write("upyun new config local temp file")
|
|
||||||
---- 关闭文件
|
|
||||||
--tempFile:close()
|
|
||||||
---- 使用 os.execute 执行 chmod 命令
|
|
||||||
--os.execute("chmod 777 " .. tempFilePath)
|
|
||||||
----print("Upyun new config local temp file path : ", tempFilePath)
|
|
||||||
|
|
||||||
|
|
||||||
local upyun, err = Upyun:new2({
|
local upyun, err = Upyun:new2({
|
||||||
user = ngx.var.upyun_operator,
|
user = ngx.var.upyun_operator,
|
||||||
passwd = ngx.var.upyun_password,
|
passwd = ngx.var.upyun_password,
|
||||||
--localFilePath = filepath -- TODO : Add a fake file for create new upyun entry
|
|
||||||
--localFilePath = "/Users/liyong/Code/AlchemyStudio/resty_functions/test_files_dir"
|
|
||||||
--localFilePath = tempFilePath
|
|
||||||
localFilePath = nil
|
localFilePath = nil
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -8,12 +8,9 @@ local cjson = require "cjson"
|
|||||||
local function upyun_upload_file()
|
local function upyun_upload_file()
|
||||||
|
|
||||||
local config = {
|
local config = {
|
||||||
--user = ngx.var.upyun_operator,
|
user = ngx.var.upyun_operator,
|
||||||
--passwd = ngx.var.upyun_password,
|
passwd = ngx.var.upyun_password,
|
||||||
user = "moicen",
|
localFilePath = "/file_upload/abc.mp3"
|
||||||
passwd = "NyJ51zRwFApY9Wo9EHJMrb8GI9YtvpVN",
|
|
||||||
--localFilePath = "/file_upload/abc.mp3"
|
|
||||||
localFilePath = "/Users/liyong/Code/AlchemyStudio/resty_functions/test_files_dir/chunxiao.mp3"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
local upyun = yun:new(config)
|
local upyun = yun:new(config)
|
||||||
@@ -34,28 +31,9 @@ end
|
|||||||
|
|
||||||
local function upyun_remove_file()
|
local function upyun_remove_file()
|
||||||
|
|
||||||
---- 使用 os.tmpname 获取临时文件名
|
|
||||||
--local tempFileName = "upyun_remove_temp_file"
|
|
||||||
---- 拼接路径
|
|
||||||
--local tempFilePath = "/tmp/" .. tempFileName
|
|
||||||
---- 使用 io.open 创建临时文件
|
|
||||||
--local tempFile = io.open(tempFilePath, "w")
|
|
||||||
---- 写入内容到临时文件
|
|
||||||
--tempFile:write("upyun new config local temp file")
|
|
||||||
---- 关闭文件
|
|
||||||
--tempFile:close()
|
|
||||||
---- 使用 os.execute 执行 chmod 命令
|
|
||||||
--os.execute("chmod 777 " .. tempFilePath)
|
|
||||||
----print("Upyun new config local temp file path : ", tempFilePath)
|
|
||||||
|
|
||||||
local config = {
|
local config = {
|
||||||
--user = ngx.var.upyun_operator,
|
user = ngx.var.upyun_operator,
|
||||||
--passwd = ngx.var.upyun_password,
|
passwd = ngx.var.upyun_password,
|
||||||
user = "moicen",
|
|
||||||
passwd = "NyJ51zRwFApY9Wo9EHJMrb8GI9YtvpVN",
|
|
||||||
--localFilePath = "/file_upload/abc.mp3"
|
|
||||||
--localFilePath = "/Users/liyong/Code/AlchemyStudio/resty_functions/test_files_dir/r2d2.jpeg"
|
|
||||||
--localFilePath = tempFilePath
|
|
||||||
localFilePath = nil
|
localFilePath = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user