Android Question FTP: Problem Upload and Download

WebQuest

Active Member
Licensed User
Hi community I am having problems downloading or uploading files with the "NET" library via an FTP. I followed the tutorial dedicated to FTP the compiler does not return any errors, even the 'Success' statement sometimes returns nothing. Use cPanel to manage the files of a domain. Are there common problems with these situations?

B4X:
 Sub Activity_Create (FirstTime As Boolean)
 Activity.LoadLayout ( "1")
 Se FirstTime Quindi
        ftp.Initialize ("ftp", "host", 21, "[email protected]", "xxxxx")
    End If
End Sub

B4X:
 Sub FTP_DownloadProgress (ServerPath As string, TotalDownloaded Long, Total As Long)
    Dim s As string
    s = "downloaded" e Round (TotalDownloaded / 1000) e "KB"
    if total> 0, Then s = s & "out of" & Round (Total / 1000) & "KB"
    Log (s)
End Sub

B4X:
Sub FTP_DownloadCompleted secondario (ServerPath come stringa, successo come booleano)
    Log (ServerPath & ", Success =" & Success)
    Se Success = False, allora Log (LastException.Message)
End Sub
Sub FTP_UploadCompleted secondario (ServerPath come stringa, successo come booleano)
    Log (ServerPath & ", Success =" & Success)
    ToastMessageShow (ServerPath & ", Success =" & Success, True)
    Se Success = False Then
        Log (LastException.Message)
        ToastMessageShow (ServerPath & ", Success" & Success, True)
    Finisci se
End Sub [/ CODE]

Sub BTInviaOrdine_Click
    ftp.UploadFile (File.DirRootExternal, "file1.pdf", True, "/ xxxx / xxxxx / xxxxxx.com / xxxxx")
End Sub
 
Last edited:

WebQuest

Active Member
Licensed User
I tried it does not work, I tried to disable the wifi in release mode, no errors but it does not work, in the FTP connection server of my hosting is connected but does not load anything, I tried with a zip file and even so it works. I'm trying this solution to load a php script that runs that connects to a mysql database. I followed the tutorial and the example "MySql" by Erel but I need to archive the php file on the server to be called. Do you know another solution?
 
Upvote 0

josejad

Expert
Licensed User
Longtime User
Have you tried with another file in DirRootInternal?
Have you permission to read DirRootExternal?
 
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
Magari prima fai un po' di pulizia nel primo post (a parte i [ CODE ] un po' incasinati, che puoi inserire a mano o tramite il menu qui sopra, quello che somiglia ad una pagina di testo... chissà cosa fai con quei "Dim s Come Stringa" :D)

Maybe you should do first some cleaning in your first post ;)
 
Upvote 0

WebQuest

Active Member
Licensed User
Sorry I have the automatic translator in the browser... It's been a while since I've tried to unravel this question
 
Upvote 0

WebQuest

Active Member
Licensed User
I think I'm confusing ... FTP is dedicated to emails, maybe I took a deprecated tutorial as an example

Credo che mi stia confondendo... FTP è dedicato per le mail, forse ho preso come esempio un tutorial deprecato.
 
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
Immagino che tu non abbia problemi con la File.DirRootExternal (per la quale è necessario che l'utente dia il proprio permesso).
Possibile l'url sia "host"? Non sono espertissimo di FTP ma mi suona strano.
Ovviamente devi avere anche i privilegi per poter scrivere in una determinata cartella sul tuo server/host.

Credo che mi stia confondendo... FTP è dedicato per le mail, forse ho preso come esempio un tutorial deprecato.
Tramite FTP puoi spedire qualunque tipo di file.

(Qui c'è anche il forum italiano, se vuoi)
------------------------------------------

I suppose you have no problems with the File.DirRootExternal (for which the user must authorize access).
Can the url be "host"? I'm not very expert on FTP but it sounds strange to me.
Obviously you must also have the privileges to write in a specific folder on your host.
 
Upvote 0
Top