Link to home
Start Free TrialLog in
Avatar of egoselfaxis
egoselfaxis

asked on

Coldfusion CFIMAGE problem - getting an error when trying to read an image URL that has a space in the filename

I'm using the CFIMAGE tag (under ColdFusion 8) to retrieve the dimensions of an image that's hosted on another website (via an absolute url):

<cfimage action="info" structname="imagesize" source="http://www.thebookco.com/images/Books/#thumbnail#">

However, ..  the value of the "thumbnail" variable will sometimes be a filename that contains a space in it, ... and whenever that happens, I get the following error message:

An exception occurred while trying to read the image.
java.io.IOException: Server returned HTTP response code: 400 for URL: http://www.thebookco.com/images/Books/portrait of a state florida.JPG

How can I get around this problem?  The source attribute for CFIMAGE has to be a URL in this case (it can't be an absolute or relative path) -- and changing the 1000+ image filenames isn't an option. Please advise.

Thanks in advance,
- Yvan

ASKER CERTIFIED SOLUTION
Avatar of duncancumming
duncancumming
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of egoselfaxis
egoselfaxis

ASKER

Hmm, .. I thought I'd tried that, but I guess I must have messed it up somehow.  Your method worked using (the replace method).  Thanks!

- yg