Can't access image - java

I am trying to display images on a JSP page.
Two hyperlinks are used to display image.
One of them is as follows:
Image
When one of the links is clicked, the corresponding image is displayed.
In the above case, MyPic.jpg is saved in web\img\MyPic.jpg(Inside the project folder).
In the other case, I saved the image in local disk.
E:\img\MyPic.jpg
and I tried the following code:
Outside image
and
Outside web
But this link is not working and I can't access the image.

Related

How to cache image downloaded from URL in Java?

I have downloaded an image from a URL using ImageIO.write, so now I am wondering if there was a possibility of somehow caching that image. Is there a possibility to compare the downloaded image with the URL it's downloaded from to know that the image is from that URL? I need this because if I download an image and than later call that same URL for downloading, my app can recognize that it already has the image downloaded, so it doesn't download it again.
You should try to see if you can integrate the code to upload the picture to google and search by image. Or, you can also save the url of the image with an array while storing the image if you have multiple images you want to download at once.

Android: Saved Thumbnail should not appear in gallery

I'm creating a thumbnail from an image. The gallery find the image and list it but I don't want that.
In the folder you're storting the image also create a file called ".nomedia". This will prevent the gallery from showing all images in that folder.
If you dont want the whole folder to be excluded. You could prefix the image name with a dot. Example: ".myimagethumb" this wil prevent the gallery from showing your file.

WebView local link

I have a WebView which reads local html file. It is a big file, so it is scrollable. I also have a link within WebView which leads to another local html file, which is a lot smaller file. When I enter that link, scroll position from first file is transferred to second file. So, second file is same size (height) as first file. I tried entering an outside link(www link) and it opens normally.
Thanks!

Export/Save jLabel contents to new folder

I have a program that perform two functions: Upload image, Export image.
after uploading an image it will shown in a jLabel,
my question : is there any way to save this image and export it to a new folder on desktop or any place the user choose?
for example, if I uploaded an image and its displayed on jLabel, when I press the Export button the program should open a dialog window asks me to choose a name for a folder and save the image in it.
Thanks in advance!
It sure is possible!
Take a look a JFileChooser, ImageIcon, and ImageIO and specifically search around for tutorials on using ImageIO

Storing Image in WebApplication Folder

I am sending image to a Servlet using html form. I am getting only filename but wants the full path of the image. Second, i want to store this image in web application images folder.
I am getting only filename but wants the full path of the image
For security reasons it is impossible to get the full path to the image on the client computer. This information is never sent to the server.
As far as the second part of your question is concerned about storing the uploaded image on the server, there are many articles out there illustrating this.

Categories

Resources