I can not get ftp to work on android

The place to discuss anything and everything about running your LiveCode on Android

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Peter@multidesk.se
Posts: 136
Joined: Fri Oct 14, 2011 6:53 am

I can not get ftp to work on android

Post by Peter@multidesk.se » Mon Jun 16, 2014 9:50 am

Has anyone figured out why a ftp call that otherwise works on iOS, does not work on android?

I have wrestled with this problem enough hours and are now stuck.

set the defaultfolder to specialfolderpath("documents")
put URL("binfile:" & "./" & "tempic222" ) into myDock
put "ftp://USER:PASS@88.111.222.99/SSIn/Uid" into myFtpUpload
replace "Uid" with myGuid & "_Sign.png" in myFtpUpload
put myDock into URL myFtpUpload
if the result is not empty then
answer the result
end if

best regards,

Peter
/*Whats all the fuss with c# ?*/

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: I can not get ftp to work on android

Post by Simon » Mon Jun 16, 2014 7:59 pm

Hi Peter,
This does not look correct:
("binfile:" & "./" & "tempic222" )
Should only be a slash. Sometimes an OS will overlook discrepancy's.

Simon
Edit: oops http://quality.runrev.com/show_bug.cgi?id=11779
Still not fixed.
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10052
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: I can not get ftp to work on android

Post by FourthWorld » Mon Jun 16, 2014 11:21 pm

Simon wrote:Hi Peter,
This does not look correct:
("binfile:" & "./" & "tempic222" )
Why break it up into three literals when it could be one?:

Code: Select all

("binfile:./tempic222" ) 
Also, unless this is for your own personal use you may want to replace the FTP call with a call to a CGI that handles file uploads. FTP sends login credentials in plain text, so anyone using the app (or any interloper) could see the network stream and get control over that account on your server.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: I can not get ftp to work on android

Post by Simon » Mon Jun 16, 2014 11:52 pm

I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: I can not get ftp to work on android

Post by Simon » Wed Jun 18, 2014 1:07 am

And not to encourage you to use FTP but the workaround for QC problem I believe is to URLEncode your username and login information.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

shawnblc
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 342
Joined: Fri Jun 01, 2012 11:11 pm

Re: I can not get ftp to work on android

Post by shawnblc » Wed Jun 18, 2014 11:07 am

FourthWorld wrote: Also, unless this is for your own personal use you may want to replace the FTP call with a call to a CGI that handles file uploads. FTP sends login credentials in plain text, so anyone using the app (or any interloper) could see the network stream and get control over that account on your server.
Could you also have the stack (local) call another stack that's located in a directory on a server? Would that help prevent your FTP login credentials from potentially being seen?

Peter@multidesk.se
Posts: 136
Joined: Fri Oct 14, 2011 6:53 am

Re: I can not get ftp to work on android

Post by Peter@multidesk.se » Sun Jun 29, 2014 9:02 am

Is it so, that FTP does not work on android and I have to use CGI for this? I read on the forum that if it works in the development environment, it is almost certainly wrong in the stand-alone settings. I've tried everything I can think of, but nothing gives results.
It works on my mac
it works on my ipad
it does not work on my HTC
Unfortunately, in this case, Android is the platform that must function.

Code: Select all

on myFTPsign
   
   put "ftp://"& FTPUSER & ":" & FTPPASS & "@" & FTPHOST & "/" & SSIn & "/" & tFileName into myFtpUpload
   replace "tFileName" with myGuid & "_Sign.png" in myFtpUpload
   put myPic into URL myFtpUpload --This is where it gets stuck
 if the result is not empty 
then
   answer the result
     exit to top
   else
      end if
      
end myFTPsign
Grateful for any assistance

/ / / Peter
/*Whats all the fuss with c# ?*/

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10052
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: I can not get ftp to work on android

Post by FourthWorld » Sun Jun 29, 2014 3:13 pm

shawnblc wrote:
FourthWorld wrote: Also, unless this is for your own personal use you may want to replace the FTP call with a call to a CGI that handles file uploads. FTP sends login credentials in plain text, so anyone using the app (or any interloper) could see the network stream and get control over that account on your server.
Could you also have the stack (local) call another stack that's located in a directory on a server? Would that help prevent your FTP login credentials from potentially being seen?
What do you mean by "call"? Do you mean "download", or "send a message to", or something else?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: I can not get ftp to work on android

Post by Simon » Sun Jun 29, 2014 9:15 pm

Hi Peter,
As long as there is no "@" in your username then it works.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7393
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: I can not get ftp to work on android

Post by jacque » Sun Jun 29, 2014 10:21 pm

You might also try url encoding the user name and password:

put urlEncode(ftpuser) into ftpuser
put urlEncode(ftppass) into ftppass
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply