Android Question File corrupted after upload

PumaCyan

Member
Licensed User
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?

 

PumaCyan

Member
Licensed User
I have not used ftp for a while, but I remember when you upload an image the fileUpload line should have False not true

So are there any alternatives for uploading files? can you provide a reference link / thread?
My upload log results say success = true
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
My upload log results say success = true
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
 
Upvote 0

mangojack

Expert
Licensed User
Longtime User
B4X:
oFTP.UploadFile(File.DirInternal, "testfile.jpg", False, "MySeverPath/testfile.jpg")

If you still have issues , maybe post some code ...
 
Upvote 0

PumaCyan

Member
Licensed User

B4X:
oFTP.UploadFile(File.DirInternal, "testfile.jpg", False, "MySeverPath/testfile.jpg")

If you still have issues , maybe post some code ...

wow ..
This is successful, so the keyword is from true or false...
Thank you very much for your help @Mahares @mangojack
 
Upvote 0

mangojack

Expert
Licensed User
Longtime User
This is successful, so the keyword is from true or false...




 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…