Download and upload a file with msinet.ocx

Posted on 2002-03-20
Last Modified: 2008-02-01

I have seen a long time ago a "one line" command with the msinet how i can get and "put" files on a server (FTP). Does anybody know the commands?

Question by:Falke
LVL 23

Expert Comment

by:Roshan Davis
ID: 6882171
Is it "Execute" ?


Accepted Solution

glass_cookie earned 50 total points
ID: 6882209

Here's a file for you over the net:

Description: Upload and download files using FTP (4K)

That's it!

glass cookie : )

Expert Comment

ID: 6882692
well, your 'one liner' is really a question of how you set up the inet control

if your ip, userid, and password are all static you can set that up in the control itself (along with the port and the type of communication) at design time, otherwise you're looking at lines of code to set that up

as to doing an upload in one line:

INet.Execute "PUT localfile remotefile"
while INet.StillExecuting

BE SURE TO INCLUDE THE DOEVENTS, if you don't the next command you issue may overlap the current commands execution and you will get an error

as to downloading..

you will have to issue the command with .Execute but after that you have to retrieve using the .GetChunk to retrieve the file piece by piece

i recommend doing a searh on MSDN for the INET Control, specifically GetChunk


Author Comment

ID: 6883924
it works perfectly

thanks a lot :)


Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VBA saving file message display 5 67
Adding to a VBA? 6 71
Prevent user closing word document opened with VB6 6 74
which modules are active in VB6 project? 6 14
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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.
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…
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…

832 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