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
helpo11

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
Kari

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: 17
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:

-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: 15
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
UsernameIssues

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:

-spaced-out1.png

Name:  spaced-out2.png
Views: 22
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
Kari

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
14 Oct 2014   #5
Kaos239

Windows 7 64bit
 
 

Hi I have been searching as to why IE is changing my hyperlinks with # to %20 when I found this thread and hope you can help me. I understand why the underscores are there my issue is when I add a hyperlink to a word document that has underscores it alters the hyperlink from # to %20. Here is an example
Social Security Act 1991 to http://www.comlaw.gov.au/Details/C20...0_Toc399337376 and this causes errors. My own IT staff are not able to answer this for me. The only reason I can think of is that as it is not the start of the page it is further down using the pages TOC this is causes this issue..... Please help.
My System SpecsSystem Spec
15 Oct 2014   #6
UsernameIssues

W7 Pro SP1 64bit
 
 

Hmmm Kaos239, you sure came up with an interesting issue (bug?).


I was able to reproduce your issue using IE11 on W7pro64bit. I then used Process Monitor to capture some of what goes on when one clicks on such a link from within an MS Word (Office 2010) document.
-ie11-1.png

I made Chrome the default browser and this is what Process Monitor captured when one clicks on the link.
-chrome.png
(Notice that there is no CreateFile operation.)

When I put IE back as the default browser, the process worked.
(i.e. IE11 opened the website to the correct location.)
-ie11-2.png

All of the Process Monitor captures pictured above were filtered to only show entries that contained "comlaw" in the Path.


So... I started all over.
I opened a W7pro64bit Virtual Machine
...installed/updated IE11
...installed MS Office 2010
...opened Word and pasted in your link.

Sure enough, IE11 failed.
Word sent "%20-%20" instead of "#".
Notice the hyphen between the each "%20".

Installing Chrome fixed the issue...
...even when IE11 was set as the default browser again
...even when Chrome was uninstalled
...even after restarting the virtual computer.
Nothing could break IE11 once Chrome had been the default browser. Unfortunately, Chrome changes a boatload of stuff in the Windows registry and we have known for a long time that uninstalling Chrome leaves stuff behind in the registry.

I'm afraid that I cannot help you fix this - unless you want to tell all of those that get your Word document to install Chrome, make it the default browser and then uninstall Chrome.

Code:
http://www.comlaw.gov.au/Details/C2014C00682/Html/Volume_3#_Toc399337377
edit: you are not alone in reporting this:
http://answers.microsoft.com/en-us/o...1e296d4?page=1

The registry entry near the bottom of page one is one of the things that I've seen after Chrome touches a computer. I find it interesting that some users in that thread seemed to have the issue even when using Chrome as the default browser.


My System SpecsSystem Spec
15 Oct 2014   #7
ThrashZone

Win-7 Home Prem 64-bit 7601 Free SP1
 
 

Interesting stuff,
All I can say is word 2007 when creating a hyperlink paste as save text only will show the correct url to the section in the drop down menu,
-weird.jpg
That was off the section below where your link pointed to,
Code:
style="width:20px;height:1px"></div></td><td><divstyle="width:20px;height:1px"></div></td><td><divstyle="width:20px;height:1px"></div></td><td><divstyle="width:20px;height:1px"></div></td><td><divstyle="width:20px;height:1px"></div></td><td><imgsrc="/WebResource.axd?d=VCF9irJdZc_LjMfCWQn6-QpbGpsZhz0oL8lU5ywN8D_sIAjLUqWzjsx-uiZKNHsAPgMdkafFDtDGfjMv2CFD1jM5BcCOObdKf9yJ4ZxmoPvj44Kw0&amp;t=635296337968570163"alt=""/></td><tdclass="tree ctl00_MainContent_ctl05_HtmlToc_trTOC_2"style="white-space:nowrap;"><aclass="ctl00_MainContent_ctl05_HtmlToc_trTOC_0 tree ctl00_MainContent_ctl05_HtmlToc_trTOC_1"href="http://www.comlaw.gov.au/Details/C2014C00682/Html/Volume_3#_Toc399337338"title="1119 Value of asset-tested income streams that are not defined benefit income streams"id="ctl00_MainContent_ctl05_HtmlToc_trTOCt1853"style="border-style:none;font-size:1em;">1119 Value of asset-tested income streams that are not defined benefit income streams</a></td>


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
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 08:12 PM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App