Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Downloading file from IE8 replaces spaces with underscores

08 Jan 2013   #1

Windows 7
 
 
Downloading file from IE8 replaces spaces with underscores

Hi All,

When I download a file from IE8, if the file name has spaces, the spaces turn to underscores. IE 8 is fully updated, and so is my Windows 7 Pro. Couldn't find a solution any where, any help would be great.

Thanks


My System SpecsSystem Spec
.

08 Jan 2013   #2

Microsoft Community Contributor Award Recipient

Windows 8.1 Pro with Media Center
 
 

Hello Helpo11, welcome to the Seven Forums.

Downloading files from Internet using Internet Explorer is not replacing spaces with underscores, they are there to start with. It is not an error or bug but instead completely normal behavior. I will try to explain it, as well as tell you how to avoid those underscores. Please read patiently to the end, it is necessary first to understand why this happens so my explanation might be a bit long...

A so called Internet address is called URL (Uniform Resource Locator,). For instance the Seven Forums URL is http://www.sevenforums.com. A URL consists of a protocol identifier and a domain name. Most common protocols are HTTP (Hypertext Transfer Protocol), HTTPS (Hypertext Transfer Protocol Secure), FTP (File Transfer Protocol) and FILE for internal file system.

More about FILE protocol identifier to better understand my example below:
You can browse your Windows computer with any browser using URL, try for instance writing file:///C:/ on your browser's addressbar and see what happens! Notice that URL starting with FILE is followed by 3 shlashes ///, not two as other URLs. First two slashes belong to protocol identifier, the third one is to tell to system browsing starts from root.

When you click a download link on a web page, it is also a URL. Look for instance the Giveaway of the Day site (gives daily one application for free), their freebie today is a program called Tilt Shift Generator. From the site you can find this download link:

Name:  Download_URL_example_1.png
Views: 6
Size:  9.7 KB

When you click the link it starts downloading. This is because when your browser does not recognize the extension of a link (URL) to be one that should be opened on browser, it correctly assumes that this URL is file to be downloaded. Typical extensions that just open a webpage are .html, .htm, .php, .asp and so on. Extensions .exe, .zip and .rar are typical examples of "downloadable" extensions.

Now the most important thing regarding this matter: A URL can not have spaces!. The same with the name of a downloadable file on a website, it can not contain spaces.

An example:
I am browsing my PC being at the moment in folder I:\Recorded TV backup\TV. I want to continue browsing with browser. I simply right click Windows Explorer addressbar and copy the address:

Downloading file from IE8 replaces spaces with underscores-download_url_example_3.png

Now let's paste the address to browser addressbar. As this address (folder path) contains spaces which are not allowed in a URL, they must be converted to something a browser can understand before the folder path can be used as a URL. This conversion is done by system, automatically. See the addressbar, the URL system has encoded every space to characters %20, ASCII code for a space:

Name:  Download_URL_example_2.png
Views: 4
Size:  26.3 KB

This, replacing spaces and other special characters on URLs to something the system can understand is called URL encoding or Percent encoding. A complete list of ASCII codes for all characters as well as more information in this matter can be found on this page.

Finally, your answer :
Those underscores are there to start with. As an old school geek from the times when spaces in filenames were absolutely forbidden, I as well as most of the geeks still don't use them. We replace spaces in filenames with underscores to make them one word. See what I mean, scroll up to the one of the screenshots in this post, hover your cursor on top of the image to see the filename I gave to that image. See?

A clickable link is often underlined so it is easy not to notice the underscore. Here a bogus link for example: www.anexamplesite.com/download_this_file. Noticed the underscores?

When you click these downloadable links on IE8 and later notice that the filename contains underscores, it is because it was originally there. IE does not change the filename when you download it.

To get rid of underscores, do not select Save when downloading. Select Save As instead and replace underscores with spaces, or change the filename to whatever you'd like to.

Kari


My System SpecsSystem Spec
09 Jan 2013   #3

W7 Pro SP1 64bit
 
 

Quote   Quote: Originally Posted by helpo11 View Post
Hi All,

When I download a file from IE8, if the file name has spaces, the spaces turn to underscores. IE 8 is fully updated, and so is my Windows 7 Pro. Couldn't find a solution any where, any help would be great.

Thanks
As Kari has explained - spaces are not allowed in a URL path...

...however IE8 should turn the "%20" that Kari mentioned back into a space for you.

Most links have an underscore under the file name which would hide any underscores might be in the original file name.

Start with a file name like:
"some image.jpg"
You might see the link as:
"some image.jpg"

Or I can start with a file name like:
"some_image.jpg"
You might see the link as:
"some_image.jpg"

How can you be sure that the original file has spaces in its file name? Are you seeing one or more "%20" replacements as shown in the first image below?

Please visit this website that I found via a random Google for "Index of":
http://www.nfsa.tv/tv_videos/

Both IE9 and IE8 downloaded the file shown below and the resulting file had spaces in the name:

Downloading file from IE8 replaces spaces with underscores-spaced-out1.png

Name:  spaced-out2.png
Views: 11
Size:  113.7 KB

Please provide a link to a file that demonstrates the problem that you are having?


My System SpecsSystem Spec
.


09 Jan 2013   #4

Microsoft Community Contributor Award Recipient

Windows 8.1 Pro with Media Center
 
 

Quote   Quote: Originally Posted by UsernameIssues View Post
As Kari has explained - spaces are not allowed in a URL path...

...however IE8 should turn the "%20" that Kari mentioned back into a space for you.

Most links have an underscore under the file name which would hide any underscores might be in the original file name.

...
...
Important addition, I forgot to mention that. Thanks.

As UsernameIssues told, URI Encoding works two ways. If a URL has encoded characters like %20 for a space, when the file is downloaded the %20 is re-converted to space.

My main point is still valid after what UsernameIssues added: IE does not replace spaces with underscores.

Kari
My System SpecsSystem Spec
Reply

 Downloading file from IE8 replaces spaces with underscores




Thread Tools



Similar help and support threads for2: Downloading file from IE8 replaces spaces with underscores
Thread Forum
Netio.sys BSOD while downloading a file in bit torrent BSOD Help and Support
IE 8 32-bit crashes when downloading any file Browsers & Mail
Why .md5 file got corrupted while file downloading via windows 7. Network & Sharing
Bsod and freezing when downloading file, defrag is unavailable BSOD Help and Support
Bug? Windows Live Mail adds underscores to attachment names Browsers & Mail
.application file type stops downloading? :/ Software

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 03:22 AM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33