August 26, 2021
CF 2021 – images not displayed
Comments
(4)
August 26, 2021
CF 2021 – images not displayed
Newbie 1 posts
Followers: 0 people
(4)

I recently installed ColdFusion 2021 (Developer edition) on a Windows 10 workstation.

I am using the built-in web server (port 8500) under:   C:ColdFusion2021cfusionwwwroot

I created a folder called “newSite”

within the newsite I have a folder called “images” — newsiteimages

If I go to http://127.0.0.1:8500/CFIDE (everythig works GREAT and CF related images are shown)

If I go to http://127.0.01:8500/newSite/index.cfm (which has an image referenced as:  /newSite/images/myimage.png)

The image does not show and when inspecting the document it states :

Failed to load resource: the server responded with a status of 404
(The requested resource [/newSite/images/myimage.png] is not available)   (even though the image is in fact present.

Is there some setting or something I am missing???

4 Comments
2021-09-02 07:57:47
2021-09-02 07:57:47

Suggestions:

1) Verify whether the file extension is JPG or PNG

2) Check the directory structure:

/wwwroot/newSite/index.cfm
/wwwroot/newSite/images/myImage.png

3) Use the image full URL or URL relative to the location of index.cfm

<!— index.cfm —>
<img src=”http://127.0.0.1:8500/newSite/images/myImage.png”>

<!— two alternative relative URLs —>
<!— <img src=”images/myImage.png”> —>
<!— <img src=”/newSite/images/myImage.png”> —>

Like
2021-09-01 21:06:22
2021-09-01 21:06:22

I’ll note that when using the built-in web server, urls (and files and folders those refer to) are indeed CASE sensitive. Are you sure that the /newSite/images/myimage.png file you refer to is in fact identical in the URL you use as in the file system? BTW, try it both in a browser, and of course check your img src tag if that fails though your browser test works.

Like
2021-09-01 19:19:32
2021-09-01 19:19:32

Try refernecing as “images/image.png”

ex –

<!DOCTYPE html>
<html>
<body>

<h2>HTML Image</h2>
<img src=”images/img_chania.jpg” alt=”Flowers in Chania” width=”460″ height=”345″>

</body>
</html>

Like
(1)
>
Priyank Shrivastava
's comment
2021-09-01 20:54:06
2021-09-01 20:54:06
>
Priyank Shrivastava
's comment

That would return a 404 error as it does not exist as the path is in fact in /newSite/images/myimage.png

The site comes up as:  http://127.0.0.1:8500/newSite/index.cfm just NO images will display.

Like
Add Comment