Re: Url encoding awry

From: Date: Thu, 11 Nov 2004 20:04:42 +0000
Subject: Re: Url encoding awry
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-201793@lists.php.net to get a copy of this message
I have a dynamically created image labeled: stories & critiques.jpg I have use url encode on it when saving it, and it is stored on the server as: stories+%26+crtitiques.jpg [snip]
If I just put the path into the browser directly it also 404's If I rename the file in any way that removes the % it works... I thought % was a legal URL encoding character?
URL encoding the file's name on disk is causing your problems. If you really want to keep it that way, you'll have to double encode the request, so that when it's decoded once you end up with "stories+%26+crtitiques.jpg". That's pretty needlessly complex. Why not just leave the file named "stories & critiques.jpg" on disk and change your image tag to <img src="stories &amp; critiques.jpg"/> ? --Rick

« previous php.general (#201793) next »