Page 1 of 2

KFTP Download

Posted: Mon Jul 14, 2014 4:26 pm
by MarcoM149
hi,
i'm trying to use KFTP in access program (VBA)
Connect works fine
Changedir works fine
alseo CreateNewDirectory works fine
but when i try to download a file i receive: Unable to get file size
Why?
this is the code:

If Not Me.kftp.Connect(WOS02FTP, WOS02UserID, WOS02PassW, WOS02Porta) Then
MsgBox "Errore di connessione " & kftp.LastError
End If
If Not Me.kftp.ChangeWorkingDir(WOS02CartellaRemota) Then
MsgBox "Errore di ChangeDir " & kftp.LastError
End If
If Not Me.kftp.DownloadFile(WOS02Remotefile, mydir, 0, False) Then
MsgBox "Errore di Download " & kftp.LastError
End If

kftp.lasterror=Unable to get file size

thanks for help
Marco

Re: KFTP Download

Posted: Mon Jul 14, 2014 4:29 pm
by Kyle_Katarn
Hi,

Are you a regsitered user ?
Which IDE do you use ? Visual Basic 6 ?
Does the problem occurs on all file ? Have you tried a different FTP server ?
Which version of K-FTP do you use ?

Re: KFTP Download

Posted: Mon Jul 14, 2014 5:38 pm
by MarcoM149
hi,
tanks for your questions.
Yes, i'm registred.
I'm using VBA (Access 2010)
I've tried with more than one file, but only with one FTP Server (i'haven't another for now)
The version of K-FTP is 4.11.501
thanks
Marco

Re: KFTP Download

Posted: Mon Jul 14, 2014 8:01 pm
by MarcoM149
Kyle_Katarn wrote:Hi,

Are you a regsitered user ?
Yes i'm registred

Which IDE do you use ? Visual Basic 6 ?
I'm using VBA (Access 2010)

Does the problem occurs on all file ? Have you tried a different FTP server ?
The problem occur on many files. I tried only an FTP server (i haven't another)

Which version of K-FTP do you use ?
version 4.11.501

Thanks for your questions
Marco

Re: KFTP Download

Posted: Mon Jul 14, 2014 8:49 pm
by Kyle_Katarn
I'd suggest ot ogive a try on another server, in order to check if problem comes from server / specific interoperability issue or client implementation.

Re: KFTP Download

Posted: Tue Jul 15, 2014 8:12 am
by MarcoM149
i tried with nother server, but i had same error: Unable to get file size
:o
Marco

Re: KFTP Download

Posted: Wed Jul 16, 2014 6:46 am
by MarcoM149
any idea?

Re: KFTP Download

Posted: Wed Jul 16, 2014 8:29 pm
by Kyle_Katarn
Do you confirm that error ONLY occurs on DownloadFile ?

Re: KFTP Download

Posted: Sun Jul 31, 2016 1:58 pm
by agaeta
Hi MarcoM149

Try to change mode to Binary before download the file.

kftp1.ChangeTransfertMode Binary

I was having same problem and file downloaded corrupted.

Re: KFTP Download

Posted: Sun Jul 31, 2016 2:00 pm
by agaeta
Try setting to binary before downloading:

kftp1.ChangeTransfertMode Binary