Solved

FTP upload using the Microsoft Internet Transfer Control

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

ScreenConnect 6.0 Free Trial

Check out the updates in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI that improves session organization and overall user experience. See the enhancements for yourself!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Hide vba in gp 7 95
Spell Check in VB6 13 114
MsgBox 4 61
Publisher:   Unknown     VB.exe Application 1 21
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

803 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