Ooops,
yup, I see, you have set up half a data center already ...
My idea was much more simple:
- Set up FileZilla Server, and create a User in it. Should be done in about 5 min.
- Create a port redirection in your router, type "FTP Server".
- Use a script like below in your app, and be done.
(Not tested, just typed down. Read twice & debug before compiling!)
Code: Select all
function transmitFile whatFile
set the defaultfolder to specialfolderPath("cache") -- assume the file is here
if there is a file whatFile then -- does the file exist?
put whatFile into myLocalFile
else
return "File " & whatFile & " not Found!"
end if
-- now set up the FTP stuff:
put "WhoAmI" into myUserName
put "tHis PasSword coUld be BeTter" into myPassWord
put "myDomain.biz/uploads/" into myFTPPath
put "ftp://" & myUserName & ":" & URLEncode(myPassWord) \
& "@" & myFTPPath & myLocalFile into myFTPURL
try
put URL ("file:" & myLocalFile) into URL MyFTPURL
-- this is for text files. "binfile:" can be helpful otherwise :)
catch Err
return Err -- something went wrong.
end try
return empty -- that's what we want to see :)
end transmitFile
This works flawlessly for me *). Even on Android for what RunRev has not much love. The lacking libURL doesn't mean you cannot do anything net-related, there's some built in functions available nevertheless.
The crucial point is to make your machine (resp. the FTP server running on it) reachable to the outer world (where your Android lives). This is done in your router. Without it you'll have no success ever. Test it with a browser, put "
ftp://222.333.222.333" into the URL field (with your real external IP instead) - you must get a log on window.
Have fun!
*) As mentioned, the script itself isn't tested. But I do these things on Android (writing logs & transmitting data to an FTP server). If it doesn't work, tell me; I'll find the working version ;-)
PS: I ignored this thread for a long time because of the "XML" in the title - for fear of bleeding eyes ;-)