Error while uploading file through ftp.

badal405

Member
Licensed User
Longtime User
Dear Erel,
I am encountering a problem while uploading a file from emulator. Here below the error code.
java.lang.RuntimeException: Error uploading file.
500 I won't open a connection to 10.0.2.2 (only to 92.253.4.198)

BTW, how could i know whether ftp has been connected or not? I use the following code. Please confirm whether it is correct or not.
B4X:
   If ftp1.PassiveMode=False Then
      'lv.AddSingleLine(ftp1.List("\home"))
      ftp1.List("/")
      ToastMessageShow("Connceted.",True)
   Else
      ToastMessageShow("Could not conncet to the server.",True)
   End If
 

badal405

Member
Licensed User
Longtime User
Dear Erel,
I tried with real device but encountering another problem. Here below the error message.

/home/prh91gf5/public_html/shaukat/1.jpg,success=false

Java.lang.Runtime EXception:Error uploading file 553can't open that file:no such file or directory

Here the code for uploading.
B4X:
ftp1.UploadFile(File.DirRootExternal, "1.jpg", True, "/home/prh91gf5/public_html/shaukat/1.jpg")

Thanks and best regards.
:sign0085:
 
Upvote 0

catyinwong

Active Member
Licensed User
Longtime User
I have the same 500 error from the FTP. The error is the same even if I test it with a real device.
But I have tried to connect to the FTP from the computer, proving that all the FTP connection and address is fine is correct..
 
Upvote 0
Top