I have a button in my app that upload a file on a server via FTP. I've taken the example someewhere here in the forum.
I use this method 'cause i need the file created from my app to be accessible from my desktop pc. And it was not being an unrooted mobile. If you know any other way to export the file from mobile to desktop I'll appreciate it.
This is my code:
Code: Select all
on mouseUp
put empty into field "esitoFTP"
--SAVE FILE
put specialFolderPath("documents") & "/censimentofiliere.txt" into tFilePath
put the text of field "testo" into URL ("file:" & tFilePath)
--SAVE ON FTP SERVER
put tFilePath into tFileForUpload
set the itemdel to "/"
put the last item of tFileForUpload into tFileName
--ftp://username:password@host/filepath
put "MYFTPSERVERPATH" into FTPHOST
put "MYUSER" into FTPUSER
put "MYPASSWORD" into FTPPASS
# Connect the start the upload
put "ftp://" & FTPUSER & ":" & FTPPASS & "@" & FTPHOST & tFileName into tDestination
libURLSetStatusCallback "uploadProgress", the long ID of me
libURLftpUploadFile tFileForUpload, tDestination, "uploadComplete"
end mouseUp
on uploadComplete pURL, pStatus
put "Status Update:" && pStatus && return before field "esitoFTP"
end uploadComplete
on uploadProgress pURL, pStatus
put "Status Update:" && pStatus && return before field "esitoFTP"
end uploadProgress
Any suggestions?