Solved

IIS 6 - Problems with long URL's- linking to em in emails

Posted on 2006-10-19
5
316 Views
Last Modified: 2006-11-19
I've got a recent issue with long URL's that I sent to people to link them digital pix/jokes that I host on my Win2k3/IIS 6 web server.

The links are long because of the sub directories so they look like


http://dnr.dyndns.org/DigPix/2006/Ireland%20Trip%20April%202006/

When I link them in emails (gmail) to friends they get EXXXXTRA characters added!

so this...

http://dnr.dyndns.org/DigPix/Misc/My%20Dog/Aug%2027%20-%201.JPG

becomes this..

http://dnr.dyndns.org/DigPix/Misc/My%2520Dog/Aug%252027%2520-%25201.JPG

and then the link doesn't open

u can see it's adding the number 25 between the spaces. Annoying

is there an IIS plugin i can get to SHORTEN the URL's?  I'd like to just give out Is this just a gmail issue? odd
I've used TINYURL before to shorten links. that worked well but isn't server side
0
Comment
Question by:GigBits
  • 2
5 Comments
 
LVL 6

Accepted Solution

by:
SCDMETA earned 125 total points
ID: 17771839
The problem is that your URLs are URLEncoded twice.

First time through all spaces are encoded to %20.

Orginal Version:
http://dnr.dyndns.org/DigPix/Misc/My Dog/Aug 27 - 1.JPG

Example of first pass encoded version with [ ] around the encoded characters.
http://dnr.dyndns.org/DigPix/Misc/My[%20]Dog/Aug[%20]27[%20]-[%20]1.JPG

Results of first pass encoding.
http://dnr.dyndns.org/DigPix/Misc/My%20Dog/Aug%2027%20-%201.JPG

The second time through all percent symbols % are convert to %25.

Example of second encoded version with [ ] around the newly encoded characters, which happen to be the % symbols created by the first encoding.
http://dnr.dyndns.org/DigPix/Misc/My[%25]20Dog/Aug[%25]2027[%25]20-[%25]201.JPG

Resulting in the double encoded URL
http://dnr.dyndns.org/DigPix/Misc/My%2520Dog/Aug%252027%2520-%25201.JPG

How are you putting the link in your emails?  Try inserting your unencoded version.  http://dnr.dyndns.org/DigPix/Misc/My Dog/Aug 27 - 1.JPG
0
 
LVL 6

Expert Comment

by:bigphuckinglizard
ID: 17772062
Spaces in filenames are the root of all evil ;-) could you just rename all the files so a ' ' becomes a '_'?
0
 

Author Comment

by:GigBits
ID: 17773019
I am generating the links from the Internet Explorer address bar, I didn't know I could just put in the unencoded version though, that works, will test and report back
0
 
LVL 6

Expert Comment

by:SCDMETA
ID: 17773113
I agree that spaces can create problems, specifically when trying to communicate the URL to another user.  Even Experts-Exchange has a problem correctly creating the link with spaces in it:

Orginal Version:
http://dnr.dyndns.org/DigPix/Misc/My Dog/Aug 27 - 1.JPG

Most email clients will incorrectly hyperlink a URL with spaces and you have to perform specific steps to have the link inserted correctly into an HTML email.  

I use Thunderbird as an email client.  It has a create link command, where you specify the text of the link , and the URL.   Good luck
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
The viewer will learn how to count occurrences of each item in an array.
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now