Solved

FTP upload using the Microsoft Internet Transfer Control

Posted on 2003-12-10
4
7,728 Views
Last Modified: 2013-12-26
Thanks in advance for any help I can get here.

Does anyone know of any good end to end tutorials for the Microsoft Internet Transfer Control.  I'm trying to include a function that will allow upload of items to an FTP server.  I've got the basic functionality down, but I dont understand exactly how I can monitor the progress of the upload.  If I can find a good tutorial, I'm pretty sure I can figure the rest out for myself.  All the documentation I can find on the internet falls far short of helpful.

Alternatively, if anyone can post a code snippet that will allow me to upload a file to an ftp server within a subdirectory of the root and monitor the progress of that upload, that would be awesome.

Thanks,

Ben
0
Comment
Question by:balabaster
  • 2
  • 2
4 Comments
 
LVL 85

Accepted Solution

by:
Mike Tomlinson earned 125 total points
ID: 9915564
There is NO way to monitor the UPLOAD of an FTP file using the Inet control.

It is possible however to monitor the DOWNLOAD of an FTP file using the Inet control.  You need to get the file size off the FTP server using the SIZE command before beginning.

Inet.Execute , "GET " & strRemoteFileName & " " & strLocalFilePath & strLocalFileName  
Do While Inet.StillExecuting
   If fso.FileExists(strLocalFilePath & strLocalFileName) Then
      Set file = fso.GetFile(strLocalFilePath & strLocalFileName)
      curFileSize = file.size
      progressbar.value = cint(curFileSize / FileSize * 100) ' or something like this
   End If
   DoEvents
Loop

You can't use this technique on the upload because the Size of the remote file being put will not be returned by the ftp server until the file is done uploading.

If you absolutely must have an upload progress bar then don't use the Inet control.  I am partial to the winsock control myself but it is a much more involved process.

Idle_Mind
0
 

Author Comment

by:balabaster
ID: 9917971
Well, thanks for that succinct answer...I guess what I have will have to do then for now until I figure something else out.  Does the Winsock control allow the monitoring of an upload?
Thanks
0
 
LVL 85

Expert Comment

by:Mike Tomlinson
ID: 9918029
The winsock control will allow you to monitor the upload and download.  You will have to manage all aspects of the ftp session though.  This means communication on both the control and data channel and handling ftp response codes manually.  It is literally a hundred fold more complex than using the Inet control.  There are many good examples of how to do this on the web and here in EE.

Idle_Mind
0
 

Author Comment

by:balabaster
ID: 9918090
Thanks dude...
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now