Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FTP PROBLEMS 2

Status
Not open for further replies.

nkyeshi01

Programmer
Nov 4, 2004
29
US
Helppppp!!

DESCRIPTION:
I'm trying to upload and download several files from a VB6 application to a server using FTP, this is how:

CODE:
Private sub upload/download_files()
for each file of list_of_files
cmd= "GET/PUT " & filename & " " & dirOfFilename & filename
'where GET is to download and PUT to upload
If inetReady(True) Then
Call SendCommand(cmd)
End If
end sub


Public Sub SendCommand(ByVal cmd As String)
On Error GoTo SendCommandErr
frmExplore.Inet1.Execute , cmd
Exit Sub
SendCommandErr:
MsgBox "Error: " & Err.Description
Resume Next
End Sub

Note: I have the upload in one sub and the download in another one.

PROBLEM:
The thing is that if I try to download 4 files it will only get 2, and for the upload is the same, the message that appears is that the Inet.stillExecuting = true. So , when I try to send the first file by the time that the cycle goes to the second file the first one has not finished.
I have tried :
inet.cancel ( it stops everything)
timer ( to wait for the response and it cycles)

what can I do????????

Thank you all
 
Hello,

perhaps this will help...

Do while Inet1.stillexecuting = true
loop

Try it and see... There may be a better way to do this, but maybe this will help you a bit.

LF
 



Hi LF,

Thanks for answering

I tried it, but it gets stock in a cycle

any other idea?

Thx

EP
 
You will need a DoEvents inside the loop, otherwise the app will never see the change

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'If we're supposed to work in Hex, why have we only got A fingers?'

for steam enthusiasts
 
THANK YOUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU GUYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYSSSSSSSSSSSSSSSSSSSSSSSSS


IT'S ALIVEEEE!!!!! IT WORKED!!!!


thank you both LF and jonhwm !!!!!!


EP
 
Hey no problem! Wow!

Thanks johnwm I forgot about that DoEvents thing. Also, I have heard that there is a way to fake the system into thinking that the screensaver is working--not too sure about this though. Do you know if this is true?

LF
 
You're welcome, and thanks for the star!

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'If we're supposed to work in Hex, why have we only got A fingers?'

for steam enthusiasts
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top