Ciao a tutti
Volendo realizzare un FtpClient per interagire con account Web usando i componenti Gb.Net e Gb.Net.Curl, ho usato il componente 'FtpClient'
Private myFtp as FtpClient
private sBuf as string
public sub Button1_Click()
with myFtp = new FtpClient as "myFtp"
.TimeOut = 120
.Debug = true
.URL = myUrl &/ myHostFile
.User = myUser
.Password = myPassword
.Get(myLocalFile)
End
public sub myFtp_Read()
Read #myFtp, sBuf, Len(sBuf)
Print sBuf
End
la funzione myFtp_Read() non intercetta e non scrive niente nella console; :'( :'(
Il file myLocalFile viene scritto ma è vuoto (0 byte) :'( :'(
C'è qualcuno che potrebbe aiutarmi (non sono tanto esperto)? ??? ??? ???
Sto usando Gambas 3.11.2 su Ubuntu 18.04 LTS
Grazie a tutti!!!
Ciao a tutti,
dopo un pò di tempo e facendo alcune prove
ho trovato(spero) la soluzione:
Il trasferimento dei file dovrebbe avvenire con il modo 'passive'
quindi:
Private myFtp as FtpClient
private sBuf as string
public sub Button1_Click()
with myFtp = new FtpClient as "myFtp"
.TimeOut = 120
.noEPSV = true ' <------------------------- Modo passivo!!'
.Debug = true
.URL = myUrl &/ myHostFile
.User = myUser
.Password = myPassword
.Get(myLocalFile)
End
In questo modo riesco a scaricare (o caricare con 'put') il file :ok: :ok:
Ciao a tutti!! :ciao: :ciao: :ciao:
PS Gianluigi se (facendo il test funziona) sarebbe utile inserirlo nella nostra Wiki? :ciao: :ciao: :ciao: