Image loading locally but not on heroku server - html

My code works fine on local deployment, but when uploaded to a heroku server, I get the error message "Failed to load resource: the server responded with a status of 404 (Not Found)" in relation to howling.jpg. Checking the directory with bash shows that the image is on my heroku server to be used but I can't figure out why it won't load it. My canvas in the html file loads without an issue.
html code of image
heroku bash displaying howling.jpg

Did you reference howling.jpg with a relative reference in your code?
If you used an absolute path the directory names may be different and you might not be able to locate your image.
What is your code that is accessing/calling the image location? can you post it here please

fixed by putting into an images folder and using app.use
fixed code

Related

Insert image into HTML page using absolute path

I'm given a task to insert an image to an index2 HTML page using absolute path, however, I'm getting this error " Failed to load resource: net::ERR_FILE_NOT_FOUND." if I use this path "images/baby-01.jpg", but If I use the relative path given below, I'm able to load the image.
<img src="/Users/gill/Downloads/Lab1/lab1-part2-images/abs-path/images/baby-01.jpg" alt="baby 01"/>"
Image path
/Users/gill/Downloads/Lab1/lab1-part2-images/abs-path/images/baby-01.jpg
The path of the page I'm trying to insert the image into.
/Users/gill/Downloads/Lab1/lab1-part2-images/abs-path/local news/index2.html
The absolute path has to be the absolute URL path and not the absolute filesystem path.
The root of the path is the directory the web server is configured to treat as a root, not the file system that the web server is installed on (otherwise, anyone could download any file from any computer running a web server).

CSS is not recognised by browser in localhost

I am creating a login/registration system and I have created a folder structure within xampp as below: htdocs > login_and_registration > css > includes > and then a number of files which are not within a folder. I managed to access the files by changing the permissions for them, however, the browser is not recognising the css and returns a Failed to load resource: the server responded with a status of 404 (Not Found). The reference to the css in my file is /css/boostrap.css and css/style.css and this was referenced via the "stylesheet' and link href. I am not sure what needs to be done to resolve this, however. Can anyone advise, please? Thanks.

Downloading file from ubuntu server through html

I have my domain pointing at a ubuntu server hosted by amazon ws, and I have my index.html file that gets loaded when someone makes a request to my domain, in the same folder of that index.html file I have another file, and I would like to make it possible to download it from my website. How can I achieve that? I tried with an iframe tag, and giving it src="./myfile.jpg" but the server tries to look for it at www.mydomain.com/myfile.jpg and it can't find it there. Can anyone give me any suggestions?
Btw my files are inside /var/www/html folder, which from what I understood is the default folder for public files on ubuntu.

Relative Paths not working on apache2 web server

Good evening!
I'm pretty new to Linux and Apache and I have a problem with relative paths. I developed my website locally on a Mac, using relative paths and everything worked fine. My files are in a folder with following subfolders:
sites
css
images
Now I'm trying to set up my website on a Linux server running Debian. Almost everything worked out perfectly and I can reach my index.html through the internet. But obviously, relative paths are not working, since I placed my images, my css-file and my other sites in above subfolders, which I try to access with relative paths, but actually they are not working. When I try to access another site (about.html) which is in the sites-folder, I just get this error:
404 Not Found The requested URL /sites/about.html was not found on
this server.
For example, from my index.html, I'm trying to access my css-file with this path:
../css/standard.css
I've also implemented external paths, these are working correctly. I'd really appreciate any help or clues. Thank you very much!
i think the mistake is in the path:
If index.html is in folder where folders "sites, css, etc" are stored, you have to use
css/standard.css
instead of
../css/standard.css

Can not load webpage in Rest webservice using apache wink

I have successfully implemented rest webservice using apache wink. I am using ant to build war and to deploy it to tomcat server. Now I want include html or jsp file in the project to display some results. But I dont know how to include it via ant build file. I tried copy and pasting the html file in the root folder as well as web-inf folder in tomcat's webapp folder and than restarted it. But so far I am not able to access it. Whenever I try to access html page it gives me error
org.apache.wink.server.internal.RequestProcessor - The following error occurred during the invocation of the handlers chain: WebApplicationException (404 - Not Found) with message 'null' while processing GET request sent to http://localhost:8080/outliers/index.html
Please help me how can I include html file in my server.
Basically you should just put the html file in the war's root directory. \
Don't put it in WEB-INF, it's is not accessible from the web!
If the html file in root directory, and you still cannot access it, check that tomcat started without errors. Sometimes errors are not displayed in console, so check the logs.