Tôi đã xem tài liệu LuaFileSystem và không thực sự hiểu cách tôi có thể tạo tệp tạm thời và ghi vào đó. Ngoài ra, tôi không chắc chắn chính xác nơi tôi có thể tìm thấy các tập tin tạm thời tôi tạo .. Trong/tmp?Tạo một tệp tạm thời trong lua
Sau đây là cách chức năng của tôi sẽ như thế nào:
do
function upload_file(web)
f = -- creates a temporary file
f:write(file.contents) -- writes the content of the file uploaded in the temp file
f:seek("set", 0) -- we go back at the beginning
s = f:read("*a") -- read it out
print (s) -- print it out
f:close() -- close it
end
end