Ho guardato il documento LuaFileSystem e non ho veramente capito come creare un file temporaneo e scrivere in esso. Inoltre, non sono sicuro esattamente dove posso trovare il file temporaneo che creo .. In/tmp?Creazione di un file temporaneo in lua
Ecco come la mia funzione sarà simile:
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