I have stored the links to images in a database so I can display them in my web application. The image folder is insider my project folder in htdocs. It works perfectly, but when I copy the project folder from the original htdocs and paste it in the htdocs of another computer, the images fail to load even though the path remains the same. I will be glad if the programmers here can explain to me what is happening. Thank you
here is the server response http://localhost:8080/folder/image/%2059f1c3840bf9b4.70759324.jpg Failed to load resource: the server responded with a status of 404 (Not Found) NB: %20 is not part of the image name. It is a space
Either your path is off, or the other machine is not using port 8080
.
Most of the time, port 80
is the default, which does not need any port suffix.
You should try:
http://localhost/folder/image/%2059f1c3840bf9b4.70759324.jpg
and if that does not do it, then open your command line and
cd path/to/localhost/folder/image/
then pwd
to get the current folder path from that location.
It should also be noted that %20
is a " "
space character, and they tend to derp up file paths frequently. For ease of reference, try not to use file names with spaces for anything served on the web.