KFTP Download

MarcoM149
Posts: 5
Joined: Mon Jul 14, 2014 4:10 pm

KFTP Download

Post 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
Kyle_Katarn
Site Admin
Posts: 1607
Joined: Sun Jul 03, 2011 8:13 pm

Re: KFTP Download

Post 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 ?
MarcoM149
Posts: 5
Joined: Mon Jul 14, 2014 4:10 pm

Re: KFTP Download

Post 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
MarcoM149
Posts: 5
Joined: Mon Jul 14, 2014 4:10 pm

Re: KFTP Download

Post 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
Kyle_Katarn
Site Admin
Posts: 1607
Joined: Sun Jul 03, 2011 8:13 pm

Re: KFTP Download

Post 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.
MarcoM149
Posts: 5
Joined: Mon Jul 14, 2014 4:10 pm

Re: KFTP Download

Post by MarcoM149 »

i tried with nother server, but i had same error: Unable to get file size
:o
Marco
MarcoM149
Posts: 5
Joined: Mon Jul 14, 2014 4:10 pm

Re: KFTP Download

Post by MarcoM149 »

any idea?
Kyle_Katarn
Site Admin
Posts: 1607
Joined: Sun Jul 03, 2011 8:13 pm

Re: KFTP Download

Post by Kyle_Katarn »

Do you confirm that error ONLY occurs on DownloadFile ?
agaeta
Posts: 3
Joined: Wed Jul 13, 2016 4:09 pm

Re: KFTP Download

Post 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.
agaeta
Posts: 3
Joined: Wed Jul 13, 2016 4:09 pm

Re: KFTP Download

Post by agaeta »

Try setting to binary before downloading:

kftp1.ChangeTransfertMode Binary
Post Reply