How to FTP?

Hello,

  Actually I have a couple questions.  The first is, is there a way to FTP a file on the local computer to a server on the internet?  If so, is there an easy way to do this?  Could you please provide some code to do so?  All I need to do is upload one text file and then disconnect.

Thanks...
ingenitoAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

autCommented:
1. Yes, what you are trying to do can be done.

2. For an easy way to do this, use the INet control...

However, this will increase the size of your application dramatically. For sample source code to an advanced way to do it (using the WinInet API), check out this url:
http://support.microsoft.com/support/downloads/LNP470.asp

The link you are looking for is titled:
"VBFTP.EXE: FILE: VBFTP.EXE: Implementing FTP Using WinInet API from VB"

Or you can download the source code directly from:
http://support.microsoft.com/download/support/mslfiles/VBFTP.EXE
(note: you have to register your copy of VB before you can download)
0
ingenitoAuthor Commented:
aut,

  Thanks, but I already had that program, but it was very confusing.  If you could, please tell me the way using the INET Control or tell me the code I need to use with the example above just to FTP a simple file.  I'll increase the points. Thanks.
0
ingenitoAuthor Commented:
by example above, I mean the WinINet API
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

mcriderCommented:
To transfer the file, put something like this in a command button:

    Inet1.URL = "ftp://www.yoursite.com
    Inet1.UserName = "yourusername"
    Inet1.Password = "yourpassword"
    Inet1.Execute , "PUT c:/windows/desktop/yourfile.txt Yourfile.txt"
    Do While Inet1.StillExecuting = True
        DoEvents
    Loop


Cheers!
0
mcriderCommented:
By the way, my answer uses the WinInet Control...


Cheers!
0
MoMarviCommented:
A good free ftp control can be downloaded at http://www.fp.gvn.net/bradley/xFtp/xftpprod.htm.

It includes full documentation, and allows for monitoring the progress of the file transfer, which the M$ Inet cannot. (This is very important for long downloaads, when you want to provide the user with some feedback as to what is going on)
0
ingenitoAuthor Commented:
mcrider,


   How do I declare this variable?  And what is the WinInet control named?  The only control I see when adding is 'Microsoft Internet Control'.  Is that the right one?
0
mcriderCommented:
To add the WinInet Control, right-click on the toolbox (the window where you select textboxes, pictureboxes, labels, etc.) and select "Components...".

Scroll down in the box until you see "Microsoft Internet Transfer Control" and select it from the list (MSINET.OCX).

Make sure you have VB Service Pack 3 installed... There are quite a few fixes in this service pack...

See Visual Studio 97 Service Pack 3 - Readme
http://msdn.microsoft.com/vstudio/sp/vs97/readme.asp 
 

Hope this helps!


Cheers!
0
ingenitoAuthor Commented:
mcrider,

  I do not have that control listed.  All I have listed is 'Microsoft Internet Controls'.  Is that the same thing?  If not, where can I get it.  Also, what is the call I would use to declare the variable?  dim Inet as what??  thanks!
0
mcriderCommented:
No, they are not the same...

Microsoft Internet Controls is SHDOCVW.DLL
Microsoft Internet Transfer Controls is MSINET.OCX

What version on VB do you have?  If you have VB5 or VB6, have you installed Service Pack 3?

Look on your system for MSINET.OCX...


Cheers!
0
ingenitoAuthor Commented:
mcrider,

  I'm sorry, I bought the Learning Edition of VB which apparantly does not come with msinet.ocx.  Thanks though.
0
BelatucadrosCommented:
This should help you, and if not, jsut search "FTP" there, there are alot of them that use the winsock API, but you weren't happy with the microsoft one so I decided to try this one ;)

http://www.planet-source-code.com/vb/default.asp?lngCId=3900&lngWId=1&blnFrm=true

Hope that helps!!
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
smilieCommented:
Hi all,

I am using "Internet Transfer Control" to send file to other servers. I am able to send file for one server like:
   Inet1.URL = "ftp://www.yoursite.com
   Inet1.UserName = "yourusername"
   Inet1.Password = "yourpassword"
   Inet1.Execute , "PUT c:/windows/desktop/yourfile.txt Yourfile.txt"

Could anyone knows how to disconnect FTP after sending a file to be able to resend to another server.
Also how to sent a file to multi FTP servers.

Pl help, thankyou.
Regards
Smilie
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Programming Languages-Other

From novice to tech pro — start learning today.