I tried to upload a file using ftp as in the tutorial here : This Thread
file uploaded successfully...
however, when the file is opened it becomes corrupted like this. is there any additional code so the file doesn't look like this?
Just replace true with false in this line:
Instead of: FTP.UploadFile(File.DirInternal, "1.txt", True, "/somefolder/files/1.txt")
use:
FTP.UploadFile(File.DirInternal, "yourimage.jpg", False, "/somefolder/files/yourimage.jpg")
True is when upload a text file, False if for other type of file. Did you try it
Just replace true with false in this line:
Instead of: FTP.UploadFile(File.DirInternal, "1.txt", True, "/somefolder/files/1.txt")
use:
FTP.UploadFile(File.DirInternal, "yourimage.jpg", False, "/somefolder/files/yourimage.jpg")
True is when upload a text file, False if for other type of file. Did you try it
Old and irrelevant tutorial. Follow this one instead: [B4X] Net library (FTP, SMTP, POP) with Wait For This tutorial covers the FTP object which is part of the Net library. The Net library is based on Apache Commons Net. Android OS doesn't allow us, the developers, to block the main thread...
www.b4x.com
- The AsciiFile parameters sets the file transfer mode. If AsciiFile is True then every occurrence of an end of line character will be translated based on the server native end of line character. If your FTP server is Unix or Linux then the end of line character is the same as Android.
In most cases you can set AsciiFile to False.
Starting from v1.70 of Net, jNet and iNet libraries the asynchronous methods return a 'sender filter' object. This object can be passed as the sender filter parameter in a Wait For call. This makes it simpler to manage multiple requests. For example: 'ftp was previously initialized and its...