use uuid to generate filename (#7)
This commit is contained in:
@@ -7,7 +7,7 @@ local cjson = require "cjson"
|
|||||||
local chunk_size = 4096
|
local chunk_size = 4096
|
||||||
local form = upload:new(chunk_size)
|
local form = upload:new(chunk_size)
|
||||||
-- local sha1 = resty_sha1:new()
|
-- local sha1 = resty_sha1:new()
|
||||||
|
uuid.seed()
|
||||||
ngx.say("...FILE UPLOAD...")
|
ngx.say("...FILE UPLOAD...")
|
||||||
|
|
||||||
local file
|
local file
|
||||||
@@ -21,7 +21,7 @@ while true do
|
|||||||
|
|
||||||
if typ == "header" then
|
if typ == "header" then
|
||||||
-- local file_name = my_get_file_name(res)
|
-- local file_name = my_get_file_name(res)
|
||||||
local file_name = "/tmp/foo.jpeg" -- todo moicen: use uuid() to generate file name.
|
local file_name = string.format("/tmp/%s.jpeg", uuid())
|
||||||
ngx.say("...CREATE FILE....")
|
ngx.say("...CREATE FILE....")
|
||||||
if file_name then
|
if file_name then
|
||||||
file = io.open(file_name, "w+")
|
file = io.open(file_name, "w+")
|
||||||
|
|||||||
Reference in New Issue
Block a user