Skip to main content
jkcrosby
Inspiring
September 15, 2014
Answered

image not loading because double-quotes not being removed from path

  • September 15, 2014
  • 1 reply
  • 304 views

I built my image paths and did a cfdump to check what is being produced:

<!--- Build image paths --->

<cfset image_src="../images/f#movie.FilmID#.jpg">

<cfset image_path=ExpandPath(image_src)>


<cfdump var="#image_src#"><br>

<cfdump var="#image_path#">

I get the following when I run the page:

../images/f5.jpg

C:\ColdFusion11\cfusion\wwwroot\workspace\OWS\images\f5.jpg

When I right-click on the image place holder and copy the image URL into a browserr address bar, what is being passed is:

http://127.0.0.1:8500/workspace/OWS/10/%E2%80%9D../images/f5.jpg%E2%80%9D

so, it is not taking out the ".. and " from around the image location of the following line as it expands the URL:

<cfset image_src="../images/f#movie.filmid#.jpg">

On another page I deleted the double-quotes and then put them back in and that worked. For some reason it didn't like the double-quotes that were there and didn't recognize the code correctly until I replaced them. I can't get that same solution to work here on this page.

Any help/suggestions? Thanks!



This topic has been closed for replies.
Correct answer jkcrosby

I just figured out that I must have cut and pasted from a website and it added MS "smart quotes" to my code.  Apparently I had these "smart quotes" in more than one place in my code.  Once I replaced them all my code worked just fine.  Thanks!

1 reply

jkcrosby
jkcrosbyAuthorCorrect answer
Inspiring
September 15, 2014

I just figured out that I must have cut and pasted from a website and it added MS "smart quotes" to my code.  Apparently I had these "smart quotes" in more than one place in my code.  Once I replaced them all my code worked just fine.  Thanks!