diff --git a/prod/upload/upload.lua b/prod/upload/upload.lua index 470f74e..fb13ead 100644 --- a/prod/upload/upload.lua +++ b/prod/upload/upload.lua @@ -7,7 +7,7 @@ local cjson = require "cjson" local chunk_size = 4096 local form = upload:new(chunk_size) -- local sha1 = resty_sha1:new() - +uuid.seed() ngx.say("...FILE UPLOAD...") local file @@ -21,7 +21,7 @@ while true do if typ == "header" then -- 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....") if file_name then file = io.open(file_name, "w+")