image save to folder in java

image save to folder in java

Hi, I am working with java. In my application i want to give facility to user to add and change image. I use open dialog box to select image, it will work properly i.e on button click open dialog is open select any image

i want to store that selected image into specified folder and that path stored into database, for furhter retrivation.

Please guide me to overcome from that problem

Thanks and Regrads

Pushpa sheela

View Answers

July 20, 2012 at 3:43 PM

ImageIcon ic=(ImageIcon)PhotoLabel.getIcon();
OutputStream out = null;
int size=0;
try {
out = new FileOutputStream("c:/Photos/"+AdmissionNoText.getText()+".jpg");

} catch (FileNotFoundException ex) {
Logger.getLogger(StudentDataMaster.class.getName()).log(Level.SEVERE, null, ex);
}
byte[] b = new byte[size];
try { 
out.write(b);
ImageIO.write(image, "jpg", out);
} catch (Exception ex) {
Logger.getLogger(StudentDataMaster.class.getName()).log(Level.SEVERE, null, ex);
}









Related Tutorials/Questions & Answers:
image save to folder in java
image save to folder in java  Hi, I am working with java. In my application i want to give facility to user to add and change image. I use open dialog box to select image, it will work properly i.e on button click open dialog
Java- Save Image into project folder in web application
Java- Save Image into project folder in web application  I have a requirement of saving the image into project folder .. which is a web application... want to save the image..when I am trying to create empty folder and get
Advertisements
Full path of image to save it in a folder
Full path of image to save it in a folder  Sir ,I am trying to upload... to find that image path &upload it as well. I am just a beginner in jsp... in the local context of your project, then you may first create a folder under WEB
i want to save image on server folder. and i want to save URL of this folder and name of image in database
i want to save image on server folder. and i want to save URL of this folder and name of image in database  hi i want to save image on server folder. and i want to save URL of this folder and name of image in database.on click
How to upload and save a file in a folder - Java Beginners
How to upload and save a file in a folder  Hi How to upload and save a file in a folder? for example Agreement.jsp File: So when... in solving the problem : Image Upload
Image is in same folder where the java file is located - Swing AWT
Image is in same folder where the java file is located  dear sir It is there in the same folder..means the photograph.jpg file is created in the same folder where my java file is present... wat I should do sir
Image name,image path into database and image into folder using jsp
Image name,image path into database and image into folder using jsp  How to insert image path and image name into oracle database and image into folder using jsp
save the uploading image with user specified name
save the uploading image with user specified name  My form consists of a textbox and an upload image with submit button.When i submit the form I want to save the uploaded image in a folder with user specfied name
save the uploading image with user specified name
save the uploading image with user specified name  My form consists of a textbox and an upload image with submit button.When i submit the form I want to save the uploaded image in a folder with user specfied name
Folder in Java.
Folder in Java.  I have any problem how to make Folder in java program? Can Anybody help me in this part
Jmagick write image to a specific folder
and save the resized images to the another location. for example : get an image to resize from c:\myDirectory\images and save the resized image to c:\myDirectory... to save the resized image to a specific location try{ String path
image upload in webapp/upload folder
image upload in webapp/upload folder  sir i want to store upload image in my project directory WebApp/Upload_image/ pls send the jsp servlet code when i upload the image one error found "system cannot found the specified path
How to save image on the server by applet
How to save image on the server by applet  HI, in my project I am... If user want to export this chart as GIF format then this chart should be save as a gif image on the server directory. Can any Body help me how can I do it Thanks
How to save image on the server by applet
How to save image on the server by applet  HI, in my project I am... If user want to export this chart as GIF format then this chart should be save as a gif image on the server directory. Can any Body help me how can I do it Thanks
Delete image from folder - JSP-Servlet
. that image name based on user id and that image is going to on folder in server after...Delete image from folder  Dear All, i used some coding... creating a new png image. in my project if two user will be login same time meanse
Delete image from folder - JSP-Servlet
Delete image from folder  Hi Thanks Rajnikant to given me reply i am not storing my image in db just userid comming from db means my image name like : Pie(userid).png which alocated in my server folder when
How to copy an jpeg image from one folder to other folder using jsp
How to copy an jpeg image from one folder to other folder using jsp  How to copy an image from one folder to another folder using jsp
Save profile and image to mysql database, and view the image in another jsp page
Save profile and image to mysql database, and view the image in another jsp page  Pls. need help in saving the profile info with the image in mysql database.. some basic code pls in jsp... thanks in advance
How to copy an jpeg image from one folder to other folder using jsp
How to copy an jpeg image from one folder to other folder using jsp  ... be in my image folder...so,How to copy an jpeg image from one folder to other folder using jsp or servlet
how to save uploaded image in database using javascript
how to save uploaded image in database using javascript  Please can you tell me how to store uploaded image in database using java I'll use the upload code as extArray = new Array(".gif", ".jpg", ".png"); function LimitAttach
ModuleNotFoundError: No module named 'django-random-image-from-folder'
ModuleNotFoundError: No module named 'django-random-image-from-folder' ...: ModuleNotFoundError: No module named 'django-random-image-from-folder' How to remove the ModuleNotFoundError: No module named 'django-random-image-from-folder' error
ModuleNotFoundError: No module named 'django-random-image-from-folder'
ModuleNotFoundError: No module named 'django-random-image-from-folder' ...: ModuleNotFoundError: No module named 'django-random-image-from-folder' How to remove the ModuleNotFoundError: No module named 'django-random-image-from-folder' error
how to store image in folder and stored image path in mysql database using JSP
how to store image in folder and stored image path in mysql database using JSP  how to store image in folder and stored image path in mysql database using JSP
How to store user name,city,state,image path into database and image into folder using jsp
How to store user name,city,state,image path into database and image into folder using jsp  How to store user name,city,state,image path into database and image into folder using jsp
How to save image after edit in php
How to save image after edit in php  Hello, I have create a simple image editor with the effected of brightness, contrast, and desaturat etc. I have... successfully but i don't know how to replace orignal image with the effects. please
Insert image from user using and save in database
Insert image from user using and save in database  when i am trying to upload a image from user and trying to save into oracle9i database...;%@ page language="java" %> <HTML> <HEAD><TITLE>Display file
Java lock file or folder.
Java lock file or folder.  Is it possible to create a desktop application to lock or encrypt file or folder in windows by using java code?? if possible can provide some reference?? because i can't find it... thanks
copy file from folder to folder - Java Beginners
copy file from folder to folder   my requirement is I need to copy xml files from one folder to another my source file contains the field filename.... Suppose in the source file, file name is goodfile1.xml source folder
java program to copy the contents of one folder to another folder
java program to copy the contents of one folder to another folder  java program to copy the contents of one folder to another folder   Have a look at the following link: Java Copy one folder to another
How can store image in server folder when deployed with a .war file?
How can store image in server folder when deployed with a .war file?  Hi all; When I am using application.getRealPath() , it return null when deployed with a .war file and when I use hard code it shows syntax error or path
Zipping folder - Java Beginners
to zip a user selected folder . this folder may contain any number of folder and sub folders. i saw an example in this site showing , how to zip a folder, i executed... solve this.. zipping folder and all of its files and sub folders. thanking
Zipping folder - Java Beginners
to zip a user selected folder . this folder may contain any number of folder and sub folders. i saw an example in this site showing , how to zip a folder, i executed... solve this.. zipping folder and all of its files and sub folders. thanking
How to access the image file from project folder itself while writing to pdf using itext?
How to access the image file from project folder itself while writing to pdf using itext?  I am writing a pdf using itext where i add a image... to search for the image in the domain folder of the glassfish location.But i want
Upload Image and save in database using jsp-servlet mvc
Upload Image and save in database using jsp-servlet mvc  Here is my...;/TD> <td><input type="file" name="Image" size="20" value="">...="file" name="Image" size="20" value=""></TD> </tr> <tr>
Upload Image and save in database using jsp-servlet mvc
Upload Image and save in database using jsp-servlet mvc  Here is my...;/TD> <td><input type="file" name="Image" size="20" value=""><..." name="Image" size="20" value=""></TD> </tr> <tr> <
how to backup files and folder with Java
how to backup files and folder with Java  Does anyone know to create a backup with java?. backup files and folders from my computer to an external...:\\Documents and Settings\\bharat\\Desktop\\bipul\\New Folder\\TableExample.java
Insert Image into Mysql Database through Simple Java Code
simple java code that how save image into mysql database. Before running this java code you need to create data base and table to save image in same database... Insert Image into Mysql Database through Simple Java Code
image upload in java
image upload in java  Hi, I am working with java. In my application i want to give facility to user to add and change image. I use open dialog box... select any image i want to store that selected image into specified folder
create folder chooser - Java Server Faces Questions
(String s[]) { JFrame f = new JFrame("Save Image"); SaveImage si = new...create folder chooser  I don't know how to create a browser folder( to save file download, for instance, not file chooser), please help me,(use swing
Record and Save Video using Java
Record and Save Video using Java  How to record video(webcam) and save it using Java.?? Its really urgent
save text file - Java Beginners
save text file  hi i have just start programming in java.please guide me if i want to read a text file in java.then the text file is save in which directory
image compression - Java Beginners
image compression  image compression in java coding
How I Choose a folder - Java Interview Questions
do not explain clearly my question. I know how I get files from a folder. My question How I select a folder. From this selected folder i get the files. I know how I get files but the problem How I choose a folder. Thanks
Zip Folder Using Java
Zipping a Folder       In this example we are going to create a zip folder and all files contained in this folder are zipped by using java. Here we will learn how to compress files
Java Util Zip. Zip files/folders inside a folder, without zipping the original source folder.
Java Util Zip. Zip files/folders inside a folder, without zipping the original source folder.   import java.io.File; import... srcFile, ZipOutputStream zip) throws Exception { File folder = new File
java image compression - Java Beginners
java image compression  image compression in java
java rotate image
java rotate image   How to rotate image to 90 and 180. can you please post an example to rotate image
image - Java Beginners
image  how to identify the watermarked image? or how to convert the watermarked image into original image? can you send that corresponding java code
Java get Folder Size
Java get Folder Size      ... to get Folder Size in Java?": folder.getName()-This method returns the folder... folder.  In the given example, we are going to show you the size
image retrieve - Java Beginners
Image Retrieve  How to retrieve the image from mysql field using java

Ads