I’m having trouble writing a file. When a user inputs text into a text field, I want to save that data in a file for uploading to a server via FTP. However, whenever a user hits the submit button, all old data in the file is overwritten and only the current text is saved in the text file. I need this file to contain a list of all user inputs.
local path = system.pathForFile(“emails.txt”, system.DocumentsDirectory)
local function saveFile()
local file = io.open(path, “w”)
if file then
file:write(textField.text)
else
file = io.open(path, “w”)
file:write(textField.text)
end
io.close(file)
end [import]uid: 186289 topic_id: 35892 reply_id: 335892[/import]