Solved

FTP upload using the Microsoft Internet Transfer Control

Posted on 2003-12-10
4
7,746 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 86

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 86

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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
Suggested Courses
Course of the Month6 days, 15 hours left to enroll

622 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