Windows

Two plus ways to transfer files via FTP in Windows

Alan Norton explains two-plus methods for transferring files via FTP using tools already provided by Microsoft Windows 7 that you may not know about.

While writing the "Core FTP LE Product Spotlight" blog post, I discovered a new way to transfer files using FTP. It led me to wonder how many other people were unaware of the two-plus ways to transfer files via FTP using only the tools provided in Windows.

I will briefly discuss each method using Windows 7 in the examples below. These instructions will also work in Windows Vista. Each method uses a different component of Windows to initiate the transfer:

  • Internet Explorer 8
  • Windows Explorer
  • DOS command line

Method One - Internet Explorer 8

Everyone who browses the Internet should be familiar with the addresses that are typed in the browser address bar to access a Web site, for example:

http://www.microsoft.com/

The address for FTP access is similar:

ftp://ftp.microsoft.com/

Type a public FTP site address like Microsoft's (Figure A) in the address bar and press [Return], and you can find knowledge base articles, patches, updated drivers, utilities, and documentation -- though the information there is now dated. View the readme.txt files at the site for more information. If you successfully connect, you should see the root directory. You can click on a directory to access sub-directories and files. Download a file by right-clicking on the file and selecting Save Target As...

This blog post is also available in PDF format in a TechRepublic download.

Figure A

Here is FTP from Internet Explorer 8.
Note: Tools | Internet Options | Advanced tab | Enable FTP folder view (outside of Internet Explorer) and the Use Passive FTP (for firewall and DSL modem compatibility) options under Browsing should be checked by default. If not, enable these options. Non-public sites require a user name and password (Figure B). This is convenient for listing the files on the remote FTP server, but if you are using IE 7 or IE 8 you will need to launch Windows Explorer to transfer files. (See Figures C, D, E, and F.)

Figure B

Non-public sites require a user name and password.

Figure C

Select Page | Open FTP Site in Windows Explorer to open Windows Explorer. Alternatively, you can select View | Open FTP Site in Windows Explorer from the menu.

Figure D

Click Allow when the Internet Explorer Security window opens.

Figure E

Enter your user name and password and select Log On to connect using Windows Explorer.

Figure F

If you connect successfully, you should be able to transfer files to and from the FTP server just as you would with any local drive.

Method Two - Windows Explorer

Method one is rather awkward. You can connect to the remote server directly in Windows Explorer (Figures G and H).

Figure G

Open Windows Explorer and type the FTP address in the address bar.

Figure H

Hit Return after typing the address, and you will be prompted for a user name and password.

But what if you routinely connect to a FTP server? You don't want to have to type the FTP address each time you want to connect. There are three ways to create a shortcut or link for quick access. First, connect to the FTP server in Windows Explorer.

Option one - Create a desktop shortcut

There are two ways to create a desktop shortcut for a file or folder for quick access:

  • Select the remote file or folder and press and hold down the [Ctrl][Shift] keys. Drag and drop the file or folder to the desktop.
  • Right-click on the remote file or folder and hold down the right mouse button. Drag and drop the file or folder to the desktop. Select Create Shortcuts Here.

Option two - Create a link under Favorites

There are two ways to create a link to a folder for quick access:

  • Drag and drop a remote folder to Favorites in the navigation pane.
  • Right-click on the remote folder and then hold down the right mouse button. Drag and drop the folder to Favorites in the navigation pane. Select Create Shortcuts Here.

Option three - Create a link under Computer

The Add Network Location Wizard will create a link under Computer in the navigation pane. Right-click on Computer in the navigation pane then select Add a Network Location to open the Add Network Location Wizard. For a complete step-by-step guide, please visit the associated TechRepublic Photo Gallery.

FTP folders in Windows Explorer

A Microsoft spokesperson sent me the following information about the features and limitations of FTP folders in Windows Explorer:

"FTP Folders work natively in the Windows Explorer and allow users to:

  • Browse them, in a limited way (no metadata or thumbnails)
  • Copy, move and delete files and folders
  • Create new folders
  • Search/filter the current view
  • Add to favorite links
  • Open Files using the Common File Dialog

Unsupported behavior:

  • You cannot copy or move files between folders on the server, only to and from your PC
  • There are no thumbnails, metadata or previews
  • You can only save to FTP folders using the Common File Dialog if the application supports opening from a virtual namespace (which is rare)
  • You cannot see Unicode file names
  • There are no secondary streams"

Method Three - DOS command line

The ftp.exe executable is a Windows utility that can be started from a command prompt window command line. You can manually transfer files using the FTP utility, but the power of this method is automation. It is a very convenient way to schedule and automate the regular transfer of files.

To view help for the FTP utility, open a command prompt window and type ftp -? [Return] at the command line. To view the commands available in FTP, type ftp [Return] to start the FTP utility and then type ? [Return] at the FTP prompt. Type bye [Return] at the FTP prompt to exit the FTP utility.

You can create batch files and FTP scripts in order to automate the file transfer process. In the following examples, replace the italicized text with your unique host name, user name, password, local path, and remote server directory.

Editor's note: The following commands are examples. You will have to adjust drive letters and folders to match your system.

Transfer a single file

Type the following into Notepad and save as H:\TransferTest\transfer.bat:

ftp -v -n -s:H:\TransferTest\transfer.ftp

This is what the ftp command does:

  • ftp -- Invoke FTP utility
  • -v -- Suppress display of remote FTP server responses
  • -n -- Suppress auto-login
  • -s: -- Specifies the path including the name of the file containing FTP commands. Note: The path cannot contain spaces.

Type the following into Notepad and save as H:\TransferTest\transfer.ftp:

open example.yourhostingsite.com

user yourusername

password

cd /public_ftp/test

put "W:\pecos-softwareworks\shtml\changes_to_the_windows7_taskbar_you_should_know_about.shtml"

bye

This is what the FTP commands do:

  • open -- Open the remote FTP server
  • user -- Log in using the user name
  • password -- Log in using the user password
  • cd -- Change to the specified remote directory where you want to upload the files, /public_ftp/test in this example
  • put -- Upload the specified local file. The quotation marks are optional if there are no spaces in the path.
  • bye -- Quit FTP session and exit FTP
Tip: FTP commands can be abbreviated to three characters, so you may see scripts written with commands such as binary abbreviated to bin. Tip: Long path names can be time consuming to type and easy to mistype. You can simplify the process by using one of these methods:
  • Navigate to the file in Windows Explorer, right-click on any part of the breadcrumb style address in the address bar, and select Copy Address as Text. Paste the address into your FTP script file and add the file name.
  • The full path including the file name can be copied to the clipboard. Right-click on a file in Windows Explorer, select Properties, and click the Security tab. Select and copy the full path next to Object name: and paste it into your FTP script file.
From a command prompt, type H:\TransferTest\transfer.bat or open the batch file to run it. You may see a Windows Security Alert (Figures I and J):

Figure I

Select the Public Networks option and click Allow Access.

Figure J

The put command uploads one file from the client to the server. If the file already exists on the remote server, it will be overwritten.

Use the get command to download one file from the server to the client.

Transferring multiple files

Type the following into Notepad and save as H:\TransferTest\multiple_transfer.bat:

cd /D W:\pecos-softwareworks\shtml

ftp -v -n -s:H:\TransferTest\multiple_transfer.ftp

Type the following into Notepad and save as H:\TransferTest\multiple_transfer.ftp:

open example.yourhostingsite.com

user yourusername

password

cd /public_ftp/test

prompt

mput "changes_to_the_windows7_taskbar_you_should_know_about.shtml" "a_case_of_maxtaken_identity.shtml"

lcd \Projects\PSWW\VIC\Package

binary

mput  "vista_image_capture_1_1_2.zip" "vista_image_capture_1_2_0.zip"

bye

This is what the FTP commands do:

  • open -- Open the remote FTP server
  • user -- Log in using the user name
  • password -- Log in using the user password
  • cd -- Change to the specified remote directory where you want to upload the files, /public_ftp/test in this example
  • prompt -- Disable interactive prompting when uploading multiple files using the mput command
  • mput - Upload the specified local ASCII files. The quotation marks are optional if there are no spaces in the path.
  • lcd - Change to the specified local directory containing the files that will be transferred, \Projects\PSWW\VIC\Package in this example
  • binary -- Switch to the binary transfer mode
  • mput -- Upload the specified local binary files. The quotation marks are optional if there are no spaces in the path.
  • bye -- Quit FTP session and exit FTP
From a command prompt, type H:\TransferTest\multiple_transfer.bat or open the batch file to run it (Figure K).

Figure K

You can do multiple transfers.

Note that I used the cd change drive and directory command in the batch file and the lcd change local directory FTP command in the FTP script to simplify the mput commands so that the relative path could be used instead of the full path.

Tip: Spaces can be problematic. Use underscore characters instead of spaces when possible.

The mput command uploads multiple files from the client to the server. If the files already exist on the remote server, they will be overwritten.

Use the mget command to download multiple files from the server to the client.

There are other variations of this method, including creating one batch file. I'll leave it to you to explore them if you wish.

Transferring ASCII and binary files

FTP handles transfers of ASCII (text) files differently from binary files. By default, the Windows FTP utility transfers files using the ASCII mode. The single file example above transfers one ASCII file. The multiple file example transfers both ASCII and binary files. To avoid possible data corruption, use the right transfer mode.

Security issues

There is one obvious security issue. If you have your user ID and password in an unencrypted text file, it can be read by anyone with access to the computer, so you will want to encrypt the FTP script file. Search for encrypt in Windows Help and click the Encrypt or Decrypt a Folder or File item or view these Microsoft Web pages for how to encrypt your data with Windows 2000, Windows Server 2003, Windows XP, Windows Vista, or Windows 7. Wikipedia lists the Windows operating systems that support the Encrypting File System (EFS). You can also use a third-party application like TrueCrypt.

Potential firewall issues

If you receive a 425 Unable to build data connection: Connection timed out error the problem is likely with your firewall. The FTP utility does not support the passive transfer mode, and this can lead to firewall issues. I received this error using Comodo Firewall 4.0, and there are several workarounds that I can detail in the forum. If you are having this issue with your firewall, you will need to configure the firewall to allow access for the FTP utility.

The final word

Before you go looking for a third-party app, take a closer look at the tools provided in Windows. One of the above methods may be the perfect solution for your FTP needs.

Susan Harkins makes a good point in "Recommend Clients Using FTP Switch to SSL or SSH" that sensitive or confidential data should not be sent using the FTP protocol.

Additional resources

Microsoft Windows Command-Line FTP Command List - nsftools.com

Active FTP vs. Passive FTP, a Definitive Explanation - Slacksite.com

ASCII or Binary? Which Files Are Which - Webweaver

Stay on top of the latest XP tips and tricks with TechRepublic's Windows XP newsletter, delivered every Thursday. Automatically sign up today!

Author's Note

I would like to thank Microsoft for their help with this article.

About

Alan Norton began using PCs in 1981, when they were called microcomputers. He has worked at companies like Hughes Aircraft and CSC, where he developed client/server-based applications. Alan is currently semi-retired and starting a new career as a wri...

37 comments
david.hunt
david.hunt

One thing that I find catches users all the time is the difference in allowable characters permitted in a URL vs that in a Filespec (Directory and Filename string). Amongst other issues, this means that when you use a browser to access files on a web server, spaces in the URL are illegal and must be encoded as "%20". On the other hand if you then use the same string with Windows Explorer, it will look for a Filespec containing a literal "%20". While placing files on a web server using Windows Explorer and reading / fetching them with a browser are not an issue, as each will treat the filespec / URL according to its native rules, the problem arrises when providing a URL for a file on an SMB file share:- - (file://server/share/file name) Sometimes the forward slash has to be escaped, so you end up with file:////server//share//file name). These will mostly work with a fat client mail program, because it accesses the file using Windows SMB rules, but when the recipient uses WebMail, the browser has an illegal URL and the link does not work. Windows Filespecs use a backslash to separate diectory names and filenames, while on Nixes and in URLs, the forward slash is used. - (file://server/share/file%20name) looks like it may fix the Browser issue, but now the fat client mail program looks for a file with the literal "file%20name" and the link does not work. I publish the following simple guidelines for our users (in a FAQ along with an explanation) to help them avoid these issues.. ...In order to avoid the problems that may occurr under different circumstances, you should adhere to these simple file and directory naming rules:- 1. Use only Arabic numbers ("0" through "9") and alphabetic characters ("a" through "z") and ("A" through "Z") along with the special characters "-", "_" and ".". 2. Do not use brackets or other special characters other than "-", "_" and ".". 3. Do not include spaces in in Directory names or Filenames. A the technique to make words obvious when run together is to capitalise the first letter of each word thus: "UseCapitalisedCharacters" (sometimes referred to as Camel Case). 4. Use the forward slash "/" instead of the back slash "\" to separate directories and filenames

kenjunior
kenjunior

I wrote a basic script file to use the dos FTP app inside of WinXP. Totally lame way to shove a file or two up to the website but once I created a shortcut to it on the desktop all my "trained monkeys" could do it. Simply double click on the icon and walk away. This was bowling stat updates and needed to have a specific set of files pushed up for each day of the week. Duplicated the file for each day and simply edited it to fit the day. Long rant short, it was there in XP and works like a champ.

bblackmoor
bblackmoor

Are you insane? *No* *one* should be using FTP. It's 2010, for crying out loud. If you run Windows, use WinSCP. It supports SFTP and SCP.

kevg
kevg

Just remember that it is CaSe senstive. So test.txt, TEST.TXT and Test.txt in the same folder are in fact 3 diffrent file.

donaldgagnon1
donaldgagnon1

Is it safe to assume that the TechRepublic Windows XP column is done and that this is now a TechRepublic Windows 7 column.

ghallahan
ghallahan

This is a great article , but in this day in age, it should made clear that msny ftp file transfer clients send userid, passwords, and the files them self as clear text.. So it should not be used to send confidential data. Many companies are switching to sFTP. If they use FTP, the first PGP encrypt or Winzip encrypt the files before placing them somewhere the ftp client can read them..

edh1215
edh1215

Are you saying this can only be done in Win7 and IE8? Method one (IE -> Page -> Open FTP site in Windows Explorer) can be done in IE7 and on Win XP. And the last time I checked, Windows Explorer opens FTP sites no matter which version of Windows you're using. This is a pretty basic function of Windows...

polingj
polingj

What about secure FTP? Can that be done through IE, Explorer or Dos? We have to send *lots* of secured documents through the internet.

NickNielsen
NickNielsen

I have to regularly download updated image files for the systems I support. Filezilla handles these gigabyte file sizes with ease. I can queue up everything I need to download and walk away knowing it will be done when I get back.

phil
phil

Why deal with these awkward Windows tools when Filezilla rules?

Daniel Breslauer
Daniel Breslauer

For quickly downloading files, I use FireFox. For heavier work, I use FileZilla.

Alan Norton
Alan Norton

So what was the 'new way' that I learned? I didn't know that Windows Explorer could be used to FTP files. As always, I will be participating in the discussion when I have something to add and to answer any questions.

Mark W. Kaelin
Mark W. Kaelin

Are you still using FTP to transfer files across your network?

Alan Norton
Alan Norton

I agree that a third party app is a good solution. The point of the article is that for many people with simple FTP needs one of these methods may be the perfect solution. Why bother downloading and installing another app if you are only periodically updating a Web site?

NickNielsen
NickNielsen

How could we possibly be so stupid as to use 30-year-old technology? We still use FTP to transfer large files. The site requires log-in, but field users do not have write access to the site. When we need secure file transfer, there's this thing called a VPN...

jtollack
jtollack

We use WinSCP for its compatibility with Linux servers. Much easier...

maj37
maj37

As others have pointed out all of this works in XP as well. I have seen Filezilla but haven't used it much, other people I know use it a lot. I use a product from a company the keeps changing it's name and the name of the product. Some times it has been SeaGull Software other times Blue Zone. Right now it is Blue Zone, bluezonesoftware.com. Their free FTP client supports ssh, and secure FTP. The reason I really like it is that I do FTP to IBM Mainframes and AS/400's a lot within our network and this product knows how to read the file lists from these platforms so you get an understandable list of files in the drag and drop windows, it also knows what a site command is. maj

skyguy1
skyguy1

I had the same thought. If you want to talk about Windows7 then get a Windows7 forum. This is for XP.

RudHud
RudHud

I just tried Method 1 (which may not be new, but was new to me) on XP Pro SP3 using Internet Explorer 8, and it worked just fine. Kinda cool, actually.

Mark W. Kaelin
Mark W. Kaelin

I have put a bounty on Windows XP looking for How do I tips. You got a new tip that has not been published on TechRepublic before and can write it up in a reasonable manner that I can publish, I'll pay you $300 for it. I have had three good ones so far.

Alan Norton
Alan Norton

No I am not saying that. The FTP behavior changed in IE7 and IE8 so the example shown does not apply to earlier versions.

bob
bob

Filezilla can work great, but getting it to work through a dsl router or firewall can be difficult. Windows explorer works 1st time every time. I don't bother with Filezilla anymore.

atuldeshmukh
atuldeshmukh

Third party apps such as FileZilla are great for working with FTP, built in ftp interface has many limitations as it does not support SFTP, FTPS or FTPES connections which is common for security reasons now a days.

bela
bela

Great, thanks! I have used Total Commander until now, but Explorer seems much simpler. And I am using automated DOS FTP batch sessions generated from programs, since they are flexible and easy to implement.

Timbo Zimbabwe
Timbo Zimbabwe

What has been described in this article is what I've been using for the past few years. This is not a Windows 7 or IE 8 only option.

alexisgarcia72
alexisgarcia72

I use ftp for upload files to my web server, for sharing files with friends, etc. In the past I used cuteftp and other ftp clients, but since 2001 I use Windows Explorer to transfer, copy, move, rename the files. Is easy as using the explorer for local files. Today I normally use services in dropbox.com and yousendit.com instead of ftp when possible.

choehne
choehne

To limit the number of files, I use a single file for both batch and ftp commands, like this: @echo OFF goto START open ftp.example.com user username password dir bye :START ftp -n < %0% | find /V "Invalid command" | find /V "Not connected." pause

techrepublic
techrepublic

If you are periodacally update a website, then you SHOULD install a good FTP-client. Just because it saves a lot of problems.. Installing is not more dan unzipping the "FileZilla_3.3.2.1_win32.zip"

brookem
brookem

WinSCP is a great way to handles large ftp and sftp uploads, like 14 GB files. FireFox is handy but tops out at 2GB. Brooke Meyer IT Architect Cary, NC

Mark W. Kaelin
Mark W. Kaelin

... this is the TechRepublic Microsoft Windows Blog, so all versions of Windows are potential topics of discussion as is anything Microsoft.

david.hunt
david.hunt

If you are using Windows Explorer to move files using SMB, then the protocol is very chatty and throughput is usually much lower over a WAN than FTP and SFTP that were designed for WAN use and not just LAN use. I'm intrigued as to how your ADSL router knows what application you are using, so as to be uncooperative! Sounds like firewall rules blocking the protocols you choose to use with FileZilla. I use FileZilla over ADSL, over NAT through SSH tunnels, VPNs, corporate LAN / WAN... No issues. It just works. Remember that normal FTP requires that the data session is built from the server to the client. This is probably your issue. Set the option for "passiv" FTP, which uses the control session for data transfer and avoids the need to build a reverse direction session which would may stopped by NAT or the lack of a "statefull" Firewall that understands FTP.

NickNielsen
NickNielsen

I run it at home through a Linksys 54G-series wireless router connected to the DSL modem. Haven't had a single problem since we got the DSL four years ago.

Alan Norton
Alan Norton

You are right. SFTP is preferable and essential if you are transferring confidential information. I have connected about a thousand times to my Web site using FTP without my credentials being stolen - or at least to the best of my knowledge. Perhaps I have been lucky? I have switched to SFTP and my first impression is that it seems slower than plain old FTP.

Editor's Picks