I'm trying to create an app for sending pictures from the device to a PC with FileZilla.
I think that my problem is that I dont actually understand what the full path is in the UploadFile function, because the client connects to the server but cannot upload anything (success is false always) and everytime I try to upload my FileZilla log says this:
(000050)03/09/2021 13:33:37 - prueba (xxx.xxx.xxx.xxx)> TYPE I
(000050)03/09/2021 13:33:37 - prueba (xxx.xxx.xxx.xxx)> 200 Type set to I
Supposedly the user autoconnects to a certain folder that I have created in the desktop. What should this path be?
B4X:
Dim sf As Object = FTP.UploadFile(sDir, foto, False, "/filezilla/sdcard/" & foto)
Hm okay. But why I get that log everytime I use UploadFile?
I have a button that calls this sub
B4X:
Private Sub btnUpload_Click
Dim sf As Object = FTP.UploadFile(sDir, foto, False, "/filezilla/sdcard/" & foto)
Wait For (sf) FTP_UploadCompleted (ServerPath As String, Success As Boolean)
If Success Then
ToastMessageShow("Uploaded con éxito", True)
Else
ToastMessageShow("No uploadeado", True)
End If
End Sub
and everytime I click it shows that message in the log :/
If you put some logs to see what's happening, you will see you're not getting the path of the image you want to upload.
B4X:
Dim sf As Object = FTP.UploadFile(sDir, foto, False, "/" & foto)
Log(sDir)
Log(foto)
You will see sDir is "/storage/emulated/0/Android/data/b4a.example/files", and obviously your image is not there. You will need the full path to the image.
I see you're using this example to get info of the choosen image, but you get just the name, not the path.
Here is what I am trying to achieve. In my app there is an option for user to select a folder and save it so that a service will copy files into it in the background whenever a certain condition is met. So basically user selects the folder once and forgets it. This folder can be in external SD...
1. Don't waste your time with activities. Switch to B4XPages. I'm familiar with B4A and know what I'm talking about.
2. Don't try to get the full path. It will not work.
3. See TextEditor example: https://www.b4x.com/android/forum/t...-save-and-load-external-files.132731/#content
Especially see the Load method. It does everything that you need. Just change the mime type.