Helping people with computers... one answer at a time.

Visual Basic is a powerful and fairly easy to use programming language. You can use a VB program to transfer files using FTP with an add-in.

How can I FTP from my VB program?

FTP or File Transfer Protocol is a common way of moving files around the internet. After HTTP (HyperText Transfer Protocol) it might well be the next most common. Normally FTP is performed by a stand-alone program. Microsoft Windows comes with an FTP client program, as does Linux. In addition there are many additional ftp clients available as well, typically providing additional features and functionality. (In the Windows arena, CuteFTP seems to be particularly popular.)

If you want to have a program you've written transfer files for via FTP then your options change. For quick and dirty solutions including most batch files or scripts, simply spawning the command line versions of existing FTP tools is a fairly reasonable compromise. I'm particularly fond of ncftpget and ncftpput that are available free from NcFTP Software for this approach. (NcFTP also produces an ftp server package for Unix, as well as a license-able cross-platform ftp library.)

If you're looking for something a little more streamlined then ChilKat FTP may be the solution, particularly if you're programming in Visual Basic. This free ActiveX control plugs in to your VB application and provides a robust and relatively easy to use interface. I recently started using ChilKat FTP in one of my applications and have been pleasantly surprised. (ChilKat also makes several other interesting plug in components, though most are not free.)

Article C1853 - October 24, 2003

Leo Leo A. Notenboom has been playing with computers since he was required to take a programming class in 1976. An 18 year career as a programmer at Microsoft soon followed. After "retiring" in 2001, Leo started Ask Leo! in 2003 as a place for answers to common computer and technical questions. More about Leo.

Not what you needed?

Recent Comments
32 Comments

You can FTP the file by using .bat file in windows.
And you can Run this .bat file in your VB program.
I have tried and it is working fine.

Dim aa
aa = Shell("D:\ftpfile.bat", vbNormalFocus)

shell function uses to call the .bat file.

Posted by: Gopinath at November 16, 2008 1:19 AM

hi ,
Can any one let me know , to create a VB script which ftp form my computer to another

Posted by: silpa at February 13, 2009 1:28 AM

One of the best Meupload file searchers and download centres is here http://megauploadfiles.com/
Find al the necessary information there!

Posted by: ula at February 25, 2009 2:04 PM

Easy.....

http://www.example-code.com/vbdotnet/ftp_upload.asp

Posted by: Sam at November 19, 2009 3:53 PM

i am looking for a replacement for FTP client for VB6. using Socket tools 2.15.

Posted by: Crystal Jefferson at January 13, 2010 9:10 AM
Post a comment on "How can I FTP from my VB program?":





Remember Me?

(You may use HTML tags for style)

Before commenting, please...

  • READ THE ARTICLE. A comment that shows you didn't will be deleted and ignored.

  • Comment only on the article. Use the search box at the top of the page if you have a question about something else.

  • NO PERSONAL INFORMATION in the comment. No email addresses. No phone numbers. No physical addresses.

  • Anything that looks the least bit like spam will be deleted. Links to unrelated sites or links that appear to be primarily promotional will be deleted, or the comment will be deleted.

  • Don't ask me to recover lost passwords or hacked accounts. I can't. Those comments will be deleted.

  • I can't respond to every comment. And I can't vouch for the accuracy of others who do.

Please wait. Your comment is being processed ...