469,352 Members | 2,107 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,352 developers. It's quick & easy.

The image name is hi%20there.jpg

Some images I want to link to using the IMG element have a name such as hi%20there.jpg. If I try to do this:

<img src="hi%20there.jpg">

the image will not be found for the browser is going to expect its name to be

hi there.jpg

which it is not.
If the image has these "encodings" in the name how can I force the browser to use the name exactly as it is?
In other words do NOT encode %20 to space? Renaming is not an option. Thanks.

--
George Hester
__________________________________
Jul 23 '05 #1
7 2498
George Hester wrote:
Some images I want to link to using the IMG element have a name such
as hi%20there.jpg.

If the image has these "encodings" in the name how can I force the
browser to use the name exactly as it is? In other words do NOT
encode %20 to space? Renaming is not an option. Thanks.


Encode the % itself: hi%2520there.gif
Jul 23 '05 #2
George Hester wrote:
Some images I want to link to using the IMG element have
a name such as hi%20there.jpg.
Why do they have such odd names?
If I try to do this:

<img src="hi%20there.jpg">
Presumably you omitted the alt attribute for brevity.
the image will not be found for the browser is going to expect its name to be

hi there.jpg

which it is not.
If the image has these "encodings" in the name how can I force
the browser to use the name exactly as it is? In other words do
NOT encode %20 to space?
RFC2396 sec. 2.4.2 says:

| Because the percent "%" character always has the reserved
| purpose of being the escape indicator, it must be escaped
| as "%25" in order to be used as data within a URI.

http://www.ietf.org/rfc/rfc2396.txt
Renaming is not an option.


I find that hard to believe, but OK.

HAGW!

--
Jock
Jul 23 '05 #3
George Hester wrote:
Some images I want to link to using the IMG element have a name
such as hi%20there.jpg.


<img alt="blah" src="hi%2520there.jpg">

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

Jul 23 '05 #4
"Leif K-Brooks" <eu*****@ecritters.biz> wrote in message news:2t*************@uni-berlin.de...
George Hester wrote:
Some images I want to link to using the IMG element have a name such
as hi%20there.jpg.

If the image has these "encodings" in the name how can I force the
browser to use the name exactly as it is? In other words do NOT
encode %20 to space? Renaming is not an option. Thanks.


Encode the % itself: hi%2520there.gif


Ah thanks.

--
George Hester
__________________________________
Jul 23 '05 #5

"Leif K-Brooks" <eu*****@ecritters.biz> wrote in message news:2t*************@uni-berlin.de...
George Hester wrote:
Some images I want to link to using the IMG element have a name such
as hi%20there.jpg.

If the image has these "encodings" in the name how can I force the
browser to use the name exactly as it is? In other words do NOT
encode %20 to space? Renaming is not an option. Thanks.


Encode the % itself: hi%2520there.gif


Request contains invalid encoding. I never seen that before.

Here is the file's name:

n00% 2008.jpg

And the link is this:

http://www.myserver.com/n00%%202008.jpg

dagone it.

--
George Hester
__________________________________
Jul 23 '05 #6
George Hester wrote:
"Leif K-Brooks" <eu*****@ecritters.biz> wrote in message news:2t*************@uni-berlin.de...
George Hester wrote:
Some images I want to link to using the IMG element have a name such
as hi%20there.jpg.

If the image has these "encodings" in the name how can I force the
browser to use the name exactly as it is? In other words do NOT
encode %20 to space? Renaming is not an option. Thanks.


Encode the % itself: hi%2520there.gif


Request contains invalid encoding. I never seen that before.

And the link is this:

http://www.myserver.com/n00%%202008.jpg


Use %2520, not %%20.
Jul 23 '05 #7
"Leif K-Brooks" <eu*****@ecritters.biz> wrote in message news:2t*************@uni-berlin.de...
George Hester wrote:
"Leif K-Brooks" <eu*****@ecritters.biz> wrote in message news:2t*************@uni-berlin.de...
George Hester wrote:

Some images I want to link to using the IMG element have a name such
as hi%20there.jpg.

If the image has these "encodings" in the name how can I force the
browser to use the name exactly as it is? In other words do NOT
encode %20 to space? Renaming is not an option. Thanks.

Encode the % itself: hi%2520there.gif


Request contains invalid encoding. I never seen that before.

And the link is this:

http://www.myserver.com/n00%%202008.jpg


Use %2520, not %%20.


Yeah actually that was what the server gave me. Wasn't me.

I fixed it. It turns out I had to Server.URLEncode in the calling ASP and escape() in the receiving ASP.

--
George Hester
__________________________________
Jul 23 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.

By using this site, you agree to our Privacy Policy and Terms of Use.