Solved

FTP upload using the Microsoft Internet Transfer Control

Posted on 2003-12-10
4
7,743 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

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…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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 Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

740 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