Unable to retrieve new image on webpage - maven

I am using Spring boot and I am still getting the old image in my web page after I swapped the image. I have cleared my browser cache, did a maven clean install and still no difference. I even changed the entire folder name where the images are kept and yet, I am still able to get the correct images when I should be getting nothing. I have double checked and it is definitely the correct path. There is no other images folder in this project to cause any confusion.
Please refer to image. The correct folder name should be "images". Instead I changed the folder name to "images1" to test and yet I get the correct images. I don't understand what kind of caching is going on here. Please advice how to clear it.

Related

images not appearing online but appears offline. I am uploading via Filezilla

I am uploading my website using Filezilla, and some images are not appearing. I have checked that the file names are all lower case and that the file type is set to auto instead of ASCII. I have cleared the cache too and I am still not seeing the same images not appearing.
I have got a 403 and 404 error on these images in the console, please see screenshot image for this.error image
All images work fine when testing locally on my computer but some random images are not appearing. Anyone any ideas why this could be?
Thanks!
image not appearing
Could you maybe provide some code with examples?
It could e.g be that the path on the server is different. If you use absolute paths it may work on your host where the homepage is under /. But if it is under /user/ or something similar (so not in the root), the paths can be broken and images will not appear. So check if you provide the paths differently for the pictures that work as opposed to the ones which fail.

/public/img/ folder not acceping new assets in Go-compiled web app

I downloaded a binary via docker for the Gogs project (https://github.com/gogits/gogs), set it up (via docker pull gogs/gogs) and the server works as expected. Now I'm trying to customize the html a bit to look consistent with our company's other tools. When looking at deployed project, the assets of interest are in the following directories:
public/img/*.png
public/css/*.css
templates/*.tmpl
When I update the css, changes take effect right away, when I update tmpl, I need a container restart (implying that html is generated at server start time), when I update anything in public/img/ directory, however, I can't seem to get those assets used at all and I'm clueless about what's happening since most web servers/frameworks treat public/img/ as a static directory with all of its contents publicly visible by default.
Here is what I've tried so far and the outcomes:
Action: copied a new favicon image (my_favicon.png) into public/img/ and changed /templates/base/head.html to point to it (/img/my_favicon.png) instead of the original (/img/favicon.png), left original untouched and restarted the container.
Result: page loads with broken image icon, DOM inspector says that it's pointing to /img/my_favicon.png but doesn't show the image, going to that URL directly doesn't show the image either.
Action: change .tmpl back to point to original image (/img/favicon.png), overwrite original with the new image. I tried this with the main lg-gogs.png logo too.
Result: page loads with broken image icon just like before.
A grep search for image name revealed that only the .tmpl I modified and config.codekit are mentioning it (and I'm not at all familiar with CodeKit, but the instructions claim that it's only relevant for git, not me, and to leave the file alone, although it seems to profile names and sizes of all images - however I don't see anything else on the server reference this codekit file).
I have no idea why changes to css and tmpl work fine, but images cause this unexpected result. Does anyone have an idea of what's going on, why the server isn't accepting the images?

Possible to clean img/p folder in prestashop?

How is it with the img/p folder in Prestashop 1.6.0.9? Is it possible fully to clean it? Cause this folder went to big now, and FTP is almost full now, i need space. For example when i renamed it on FTP, all images on the website worked, and prestashop created automaticaly one new img/p folder, and all seems that works right (also when the initial img/p was out after renaming). Thanks in advance.
when you delete the folder you may see the images working, its from smarty cache, once you clear the smarty cache, presta default (not found) image will be shown.

Not able to upload pictures with magmi.

I've recently moved my website to a new server (shared). I made a backup with installtron and put everything in place on the new server.
Every went pretty smooth, but i'm facing some difficulties with uploading my feeds via magmi. I'm getting errors when im using the image attribute processor. The following erros pop up:
download error,URL http://mydomain.com is unreachable.
The stupid thing is that the image link he's pointing to is working and points to the picture, but somehow it is not uploading it. This was working at my previous website. I'm pretty sure it has something to do with write permissions, but i can't figure out which one it is. Permissions are all set to 755 (shared hosting)
Anybody has any idea?
I found the error. It had something to do with the fact that i filled a path "Image search path" within the image attribute plugin. I thought that would not matter if i would point to an absolute path in my csv file, but apparently it did. After i removed the location there it did upload my pictures pointing to an absolute path.
Thanks all!

How to download images from the same folder as where the image is uploaded?

I am creating a project wherein the user can upload his photo. This photo is stored in the folder "images/uploads/filename". When his profile is created and the photo is to be shown, I use the <img> tag with src as "images/uploads/filename", but the photo does not show up.
If I manually copy the photo to an adjacent folder "images/abc/filename" and then use it as the source then it works.
How is this caused and how can I solve it? I need to use the same folder to upload and download photos.
That can happen if you're running the webapp as an IDE project and are storing the uploaded images in the IDE's project space. Changes in the IDE's project folder which are performed externally (as by your servlet code) does not immediately get reflected in the deployed server's work folder. Only when you touch it (by refreshing the project) or by copying it (as you happen to have found out), then it will get reflected.
After all, storing uploaded files in the webapp's deploy folder is a bad idea. Those files will get all lost whenever you redeploy the webapp, simply because those files are not contained in the original WAR file.
You need to store them somewhere outside the webapp's deploy folder on a different fixed path like /var/webapp/uploads. You should not use relative paths or getRealPath() to create the File object around it. Just use a fixed path. You can always make the fixed path configureable as a context param setting, a VM argument, a properties file setting or even a JNDI entry.
Then, to serve it to the world wide web, just add exactly that path as another docroot to the server config. It's unclear what server you're using, but in Tomcat it's a matter of adding another <Context> to the server.xml.
See also:
Uploaded image only available after refreshing the page
How I save and retrieve an image on my server in a java webapp
Make sure your have the correct path and include the image extension
just for testing, put your img tag inside the index.php
<img src="images/abc/filename.jpg">
/root/index.php
now put you image in to the your abc/ folder
/root/images/abc/filename.jpg
This should display the image.
if you have your img tag inside another folder in the root like below
/root/user/index.php
now when you use you img tag use this path (relative link):
<img src="../images/abc/filename.jpg">
note the beginning of the image path "../" this is used to go back to the root.
if the php or html file that is holding the img tag is even deeper, just remember to add ../ for every level, 2 folders deep whould be:
<img src="../../images/abc/filename.jpg">
Question was quite vague so hope this is what you are looking for.
let me know and if this is wrong, explain a little more and i will try to help :)

Resources