Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

FTP upload using the Microsoft Internet Transfer Control

Posted on 2003-12-10
4
Medium Priority
?
7,753 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 86

Accepted Solution

by:
Mike Tomlinson earned 500 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

824 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