Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Space in Img File Name - Renders in FireFox but Not IE

Participant ,
Jun 15, 2009 Jun 15, 2009

I have an online store, some of the image file names have a space in them.  This still displays fine in FireFox but not in IE.  I tried to replace the space with a %20 thinking that this will render the image in IE and it still does not show in IE but will show in FireFox w/ the %20.

Here is my code:

<cfset sImage3 = "#reReplace(SImage,' ', '%20 ', 'all')#" >
                <IMG SRC="#Trim(sImage3)#" BORDER="0" >

Any suggestions?

1.5K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Jun 15, 2009 Jun 15, 2009

Instead of a regular expression, try using the built-in function, URLEncodedFormat:

http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=functions_t-z_10.html

It should do the trick for you.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jun 15, 2009 Jun 15, 2009

I changed the code to read:  <IMG SRC="product-images/small/#URLEncodedFormat(Trim(sImage2))#" BORDER="0">

The image still only displays in FireFox but not in IE.

When looking at the source for the image it reads the following:

FireFox: http://lightsunlimitedinc.com/product-images/small/4404%20GR%2EJPG

IE: http://lightsunlimitedinc.com/product-images/small/4404%20GR.JPG

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Jun 15, 2009 Jun 15, 2009

I was only able to see the image in Safari (Mac and PC). I could not see it in IE 8, IE 7, Firefox 3 (Win) and Google Chrome 1. In Firefox 3 on Windows, I got an error message:

The image “http://lightsunlimitedinc.com/product-images/small/4404%20GR%2EJPG” cannot be displayed, because it contains errors.

I then downloaded the image from Safari (since I could see it in this browser) and checked it's properties. According to the file information, the image was saved with the CMYK color space. This is not supported in most browsers and I believe that's the issue and not the file name's format.

If you are able, I would recommend grabbing the above file/image from the server. Then, edit it in an image editing program such as Photoshop or Fireworks (ensuring that you save it with the RGB color space and not CMYK). Finally, upload it to the server, overwriting your existing image, and open the above URL in your browsers. You should now be able to see the image in Internet Explorer (IE does not support CMYK images) and other browsers.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jun 15, 2009 Jun 15, 2009

That does seem to be the problem  I downloaded a couple of test images, opened them in PhotoShop and resaved/upload and I can now see the images.  the problem I have now is there are around 130,000 images that will need to be batched and saved and reuploaded.  Not looking forward to this.

thanks

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Jun 15, 2009 Jun 15, 2009
LATEST

Oh, man, that's brutal! Are you familiar with creating actions/batches in Photoshop? If not, check into them, it could save you some serious headache!!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources