To Upload picture from Mobile to FTP ?

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
mulandc@yahoo.fr
Posts: 13
Joined: Wed Feb 25, 2015 2:15 pm

To Upload picture from Mobile to FTP ?

Post by mulandc@yahoo.fr » Wed May 13, 2015 8:19 am

I make an App from which I can upload easily picture from destop to my FTP but from my mobile I cannot upload to FTP. someone can help me ? please here is my code:

on mouseup
global id_crt

add 1 to id_crt
put "/"& id_crt &".png" into cs
put image "picture" into tImageUpload

put "ftp://"&Username&":"&password&"@"&"host/filepath" & cs into uploadURL
libURLftpUpload tImageUpload,uploadURL

if the result is not empty then
answer "url put failed:" && the result
else
answer "Upload is done!"
end if
end mouseUp

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am
Location: Bordeaux, France

Re: To Upload picture from Mobile to FTP ?

Post by Dixie » Wed May 13, 2015 8:37 am

from the iOS release notes..
Note: When using URLs for these protocols be aware that the iOS system functions used to provide them are much stricter with regards the format of URLs – they must be of the appropriate form as specified by the RFC standards. In particular, in FTP urls, be careful to ensure you urlEncode any username and password fields appropriately (libUrl will allow characters such as '@' in the username portion and still work – iOS will not be so forgiving).


To upload a file to an FTP server, do something like...

Code: Select all

put tData into url "ftp://ftp.server.com"

mulandc@yahoo.fr
Posts: 13
Joined: Wed Feb 25, 2015 2:15 pm

Re: To Upload picture from Mobile to FTP ?

Post by mulandc@yahoo.fr » Wed May 13, 2015 9:33 am

I try it but not working

Klaus
Posts: 13820
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: To Upload picture from Mobile to FTP ?

Post by Klaus » Wed May 13, 2015 11:38 am

Cher monsieur mulandc@yahoo.fr,

no idea why you post this in the ANNOUNCEMENT section? :shock: 8)
Will move this to the beginner thread.


Best

Klaus

mulandc@yahoo.fr
Posts: 13
Joined: Wed Feb 25, 2015 2:15 pm

Re: To Upload picture from Mobile to FTP ?

Post by mulandc@yahoo.fr » Fri May 15, 2015 10:55 am

I think I solved the problem. the code looks like that:

on mouseup

global id_crt

add 1 to id_crt
put "/"& id_crt &".png" into cs
export image "picture" to file specialFolderPath("camera")& "/id_crt.png" as PNG
put url ("binfile:" & specialFolderPath("documents") & "/id_crt.png") into tImageUpload

put tImageUpload into url ("ftp://"&Username&":"&password&"@"&"host/filepath" & cs)

if the result is not empty then
answer "url put failed:" && the result
else
answer "Upload is done!"
end if
end mouseUp

Klaus
Posts: 13820
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: To Upload picture from Mobile to FTP ?

Post by Klaus » Fri May 15, 2015 12:43 pm

specialFolderPath("camera")
Really? :shock:
Are you sure?

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”