How to save image using an image object in servlet on web server

I'll be very thankful to anyone who helps me in this matter.
i developed an applet which draws on a buffered image.
now i want to save this buffered image as a jpg image on the web server.
i know i have to use servlets or jsp for this.
but i want to use servlet for specific reasons.
can anyone plz provide me the code for taking an image object from an applet and saving it thru servlet.
i need this solution as soon as possible.
thanks in advance.

Take a look around for URLConnection, and Applet to Servlet communication (also check the [url http://forum.java.sun.com/forum.jsp?forum=33]Servlet forum).
Basic concepts will be to open a URLConnection to the URL mapped on your server for the servlet, then send the image, byte by byte, to the servlet, then ask for a reply from the servlet.
Once asked for a reply the servlet will need to take the image sent to it (hopefully via an HTTP post) and copy it to a location on disk. (You could have a parameter to the request that tells you want to name the file...)
As for the converting buffered image to JPEG, I haven't done this before, but I know others have. You can look around (more likely to find it in the [url http://forum.java.sun.com/forum.jsp?forum=31]Java Programing[ul] forum) for the code needed.

Similar Messages

  • E61i -- HOW TO SAVE IMAGES FROM WEBSITE WHILE BROW...

    ANYBODY KNOWS HOW TO SAVE IMAGES FROM WEBSITE WHILE BROWSING IN E61i ???
    ABDULLAH SHAHID SHEIKH
    IMANGROUP, IMAN ROAD, NOORPUR, ALI BLOCK, MUSLIM TOWN, FAISALABAD, PAKISTAN.
    TEL. 0092418782792-93
    CELL. 00923008651424

    which version should i use ,, i mean suitable for my E61i,,, the opera mini or the opera mobile????
    is opera mini can save the images as well???
    25-Aug-200702:43 PM
    iantaylor27 wrote:
    Hi
    If you use opera mobile, it aloows saving of images to memory card etc
    www.opera.com
    ABDULLAH SHAHID SHEIKH
    IMANGROUP, IMAN ROAD, NOORPUR, ALI BLOCK, MUSLIM TOWN, FAISALABAD, PAKISTAN.
    TEL. 0092418782792-93
    CELL. 00923008651424

  • How to save image files into SQL Server?

    Hello, All:
    Does anyone know how to save image files into SQL Server? Does the file type have to be changed first?? Please help me! Thank you!

    You need a BLOB field (usually)... Then you can check this tutorial out:
    http://java.sun.com/developer/onlineTraining/Database/JDBC20Intro/exercises/BLOBPut/
    There are other exercises on that site, including one on reading the images back.

  • How to save image catch from USB camera to database ?

    Hi guys.
    I needed help on IMAQdx tools. But i dont know how to save image that catch from USB camera to database.

    So you can acquire the image OK?
    And you want to save it to a SQL database?
    See here:
    http://zone.ni.com/devzone/cda/epd/p/id/5210

  • How many space is used by an object

    Hi @ all,
    my english isn't very well but I hope you will understand me.
    I have to find out how many space is used by an object at runtime. The goal is to get information about the actual used space by an objectbuffer. (I mustn't use jvmpi or something else)
    Do you have an idea?
    best regards

    Try playing with the following code:
    import java.io.*;
    class IWantToBeMeasured implements Serializable {
        String[] stringArray = new String[1000]; //-- you'll waste at least 4 * 1000 bytes here...
        byte[] byteArray = new byte[1000]; //-- you'll waste at least 1000 bytes here...
        public IWantToBeMeasured() {
            //-- generate 1000 distinct strings "12345" // so you'll waste at least 5 * 1000 * 2 bytes here...
            for (int i = 0; i < stringArray.length; ++i) {
                stringArray[i] = String.valueOf (12345);
            //-- just fill 1000 bytes, and make all different, to avoid some optimizations
            for (int i = 0; i < byteArray.length; ++i) {
                byteArray[i] = (byte)i;
    class Test114 {
        public static void main(String[] args) {
            int estimatedObjectSize = -1;
            try {
                ByteArrayOutputStream baos = new ByteArrayOutputStream ();
                ObjectOutputStream oos = new ObjectOutputStream(baos);
                IWantToBeMeasured iwtbm = new IWantToBeMeasured ();
                oos.writeObject (iwtbm);
                oos.flush();
                estimatedObjectSize = baos.size();
                baos.close();
            } catch (IOException ex) {
            System.out.println ("Estimated object size = " + estimatedObjectSize);
    }It prints "Estimated object size = 9154".
    Well, do you expect a number that's greater than 15000 here. Why my program printed 9154?
    There is a problem here. I know that a string is stored in Unicode in memory, so each character must occupy 2 bytes. But strings are serialized in UTF-8 encoding, that use only 1 byte for each ASCII character. Then the program printed 9154 , that's yet smaller than 4000 + 5000 + 1000.
    I leave the problem to you.

  • How to save Image from binding FlipView?

    I bind 4 images in my FlipView, how save an binding Image to Picture Library;
    <FlipView Name="display1"  ItemsSource="{Binding}" Foreground="#FFE6D52E" HorizontalAlignment="Center" VerticalAlignment="Center           
                <FlipView.ItemTemplate>
                    <DataTemplate>                  
                                <Image x:Name="image" Source="{Binding  Path=Image}" Stretch="UniformToFill"/>                
                    </DataTemplate>
                </FlipView.ItemTemplate>
            </FlipView>
    private void SaveImage_Click(object sender, RoutedEventArgs e)
                  var img = display1.SelectedItem as WriteableBitmap;
                           StorageFolder appfolder = await   KnownFolders.PicturesLibrary.CreateFolderAsync("myimage",          
    CreationCollisionOption.OpenIfExists);
            StorageFile myFile = await appfolder.CreateFolderAsync("imge1.jpg", CreationCollisionOption.ReplaceExisting);    
            img.Invalidate();
            using(Stream strem = await myFile.OpenStreamForWriteAsync())
                img.Savejpeg(strem, img.PixelWidth, img.PixelHeight, 0, 100);
    //for me it is  hard to save binding files,I cant save any image

    Hi Icce cage,
    Per my understanding, you bind the path of image to Image control, so you get image path string from display1.SelectItem property. Try finding Image from this path in installation folder and then copy it to Picture library. Please try the following code
    snippet.
    Custom class to hold the image object.
    public class CustomClass
    public string ImagePath { get; set; }
    public string ImageName { get; set; }
    Initial image sources.
    private void Page_Loaded(object sender, RoutedEventArgs e)
    images = new System.Collections.ObjectModel.ObservableCollection<CustomClass>();
    images.Add(new CustomClass() { ImagePath = "/Images/1.png", ImageName = "1.png" });
    images.Add(new CustomClass() { ImagePath = "/Images/2.png", ImageName = "2.png" });
    images.Add(new CustomClass() { ImagePath = "/Images/3.png", ImageName = "3.png" });
    images.Add(new CustomClass() { ImagePath = "/Images/4.png", ImageName = "4.png" });
    images.Add(new CustomClass() { ImagePath = "/Images/5.png", ImageName = "5.png" });
    display1.ItemsSource = images;
    XAML.
    <FlipView RightTapped="display1_RightTapped" Name="display1" Foreground="#FFE6D52E" HorizontalAlignment="Center" VerticalAlignment="Center" >
    <FlipView.ItemTemplate>
    <DataTemplate>
    <Image x:Name="image" Source="{Binding Path=ImagePath}" Stretch="UniformToFill"/>
    </DataTemplate>
    </FlipView.ItemTemplate>
    </FlipView>
    Save image to picture library.
    private async void display1_RightTapped(object sender, RightTappedRoutedEventArgs e)
    CustomClass data = display1.SelectedItem as CustomClass;
    if (data!=null)
    var installation = Windows.ApplicationModel.Package.Current.InstalledLocation;
    var imagesfolder =await installation.GetFolderAsync("Images");
    var file = await imagesfolder.GetFileAsync(data.ImageName);
    await file.CopyAsync(KnownFolders.PicturesLibrary);
    Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. Click HERE to participate
    the survey.

  • HOW IT SAVES IMAGE IN TABLE?

    Hi friends,
    I have 1 table test with fields:
    eid number,
    e_pict long raw.
    I have saved images through a form to the table from a file.
    after saving I tried to see the table's data:
    SQL> SELECT * FROM TEST;
    EID E_PICT
    123 4
    20
    789 4
    456 4
    4897 4
    128 5
    6 rows selected.
    I've found for same type of image (say .gif) the E_PICT value is same, only when change the image type the value changes and does not depend on path or filename. Then how Oracle keeps track of exactly which image is saved?
    Pls help me.
    Regards,
    Pragati.

    What version of Oracle, and what are you hoping to do with the images?
    Oracle has something called interMedia which is included free in the Standard and Enterprise editions of the database. It handles audio, image and video.
    The documentation even includes "The interMedia PL/SQL Web Toolkit Photo Album sample application" which demonstrates how to perform the following operations:
    *Use the interMedia image object type to upload, retrieve, and process media data stored in Oracle Database.
    *Combine the image metadata methods of interMedia with the XML document management capabilities of Oracle XML DB and the full-text indexing and search features of Oracle Text to create a solution that can extract, store, and search metadata that is embedded in binary image files.
    *Collect new metadata from a user, format the metadata into an XML document, and store the document in the binary image.
    http://download-east.oracle.com/docs/cd/B19306_01/appdev.102/b14302/ch_webapp.htm#sthref144

  • How to save image in database

    hi ,
    I am developing a application. i want to upload image with person's details and save it to database. How to do this? I hv got tutorials for uploading image but want to know how to save it to database table along with person's details.
    Thanks in advance.
    Regards
    Rajaram

    1.Go to transaction SE78.
    2.Select tree menu: Form Graphics -> Stroed on Document Server -> Graphics General Graphics -> BMAP Bitmap Images
    3.Select <IMPORT> to import bitmap image file to SAP. System will popup screen for input file information and target name.
    4.Select <Tick> After you already input data. System will upload image and return message to tell you success or fail.
    5.You can preview the picture that uploaded by select<print prv>
    If u want to store the images and retrive it from the server corresponding to the person id then just save the image by person id and code it as per the requirement.
    U can save ur images using se78 and also u can c it using TCODE AL11.By navigating thru the exact path u can get the images.

  • How to display "Image" object in the browser?

    can anyone please tell me how can i display "Image" object in the browser?
    I have an image object that i retrieved from AS400 BLOB object by using toolbox.jar (for as400 access for java including all necessary classes like jdbc driver, security etc.).
    i want to display this object in the browser so i will be able to web-enable my BLOB objects stored on as400.thx...

    In your HTML:
    <img src="ImageServlet">
    In ImageServlet:
    Make calls to DB to get your image as byte array and store it in:
    byte[] buffer = new byte[imageSize];
    ServletOutputStream out = response.getOutputStream();
    for(int i = 0; i < imageSize; i++)
    out.write(buffer, i, 1);
    out.close();

  • How to save image to local machine

    how to save my drawing (image or movieclips) to my local sytem without any server side script . i m using player 10. Please share some example

    I don't think that will bwe possible
    As that will be a hack in terms of an internet user.
    However usual solution to this is save your file at server and give user a bitton or some interface to download it

  • How to Save image in a text to my photos

    How do I save the photo in a text message to my iPad air photos?

    Tap the image in Message. (If you touch too long it brings up the: Copy; Other... menu instead)
    This blows the image up to full screen.
    Touch the image again to get menu options.
    In the top right corner, tap the box with the up arrow.  One choice is Save Image.  Touch it to save to your camera roll.
    In the top left corner, the three-line menu shows you all the photos in the message string, and some metadata like image size and camera title/image number.
    This is in IOS 7.1.1 on an iPad, and should work on iPhone and Touch also.

  • How to save image from email to iPhoto

    trying to save image attachment from email to iPhoto

    What is the problem? What does not work?
    Either drag the attachment from the mail to the iPhoto con in the Dock, or ctrl-click the attachment and use the option "Export to iPhoto" from the pop-up menu (in Mail in MacOS X 10.10). Don't remember, if this worked in Mail in Mac OS X (10.5.8), as your signature is showing.

  • Problem with how FeuerFuchs saves images

    FeuerFuchs presently seems to work like this. You load a page displaying an image or images. You like one or more of them and you want to save them. Each time you tell FeuerFuchs to save an image, instead of copying that image from wherever it's stored in order to display it on your screen to the folder you want to save it to, FeuerFuchs re-downloads that image.
    Can someone please tell me why FeuerFuchs is programmed to re-download images it's told to save instead of copying them from wherever they're stored in order to display it on the screen? It seems like that only serves to increase bandwidth usage.

    I've got that and it's great for if I want to save all the images from one or more tabs. But it only saves images from entire tabs instead of one out of several images in a tab and the treeview navigation is slower than using the shortcuts I use to jump from one folder to the next.

  • How to "Save Image" directly instead of "Save Image As"?

    Is there anyway or option to directly save images instead of having to click "save image as" then go into the popup to save the image location? Thank you!

    Gingerbread Man made good suggestions.
    However you still must "save as" something even if "unnamed001". Windows requires a name and location for each file (whether an image or other file) saved. You can have the same file name in different directories (folders).
    You can copy and paste images without saving, in some applications.

  • How to save a file with smart object?

    I have just created a file from LR2, by choosing 'open as smart object' in PS.
    I then added a cloning layer and did my cloning.
    When I wanted to save the file, instead of PS turning it in into a PSD with the same name, I now suddenly got the 'save as' pop up screen and '-2' as the recommended name. The original folder where the file came from was not shown.
    I don't know what that's all about, but I'd prefer it would just save the file as a PSD and automatically show the file alongside the NEF in LR2, like it does when I don't use the 'open as smart object' feature. Is this typical for working with smart objects opened straight from LR2?
    Any help will be greatly appreciated.
    Marsel

    Well, like this you open the file s a smart object, so if you want to now clone on a layer but want it to be a part of the smart object then you go to the layer panel and click on the smart object's icon there to edit the smart object and you hit save (command S) and it will save with that layer to your original.
    then when you click the tab or the window that has the original opened as smart object those changes will be reflected, but you will not see your cloned layer active as that is a part of the smart object and you have to open the smart object to get to it.
    What you say! Yes that is what I say that is what a smart object is, you are using the smart object as a part of another document( that is why you are being asked to save as, as this new documents you can now make changes which will not effect the original which is the smart object unless you rasterize it which will make it no longer a smart object.
    What good is a smart object, well there are many say you are using this document or image if you wish in say five projects and the image has been retouched and it is determined it should have some more work done to it all you have to do is retouch the smart object and all five projects are updated.
    You see smart.
    And of course you can d things to all five projects that can be different from one another on other layers without ever destroying the work you have done to the smart object.

Maybe you are looking for

  • How do I dial a phone number from Forms6i ?? OLE2,DDE??

    How do I dial a phone number from Forms6i ?? OLE2,DDE?? Is it do-able?? I have a contact form that has the contacts phone number, etc... I would like to add a button to dial the number which would open the phone line (probably through my modem) and d

  • How do you get rid of the "other" space on an iphone 4

    I want to know how to get rid of the "other" space on an iPhone 4 that doesn't require you restoring your phone back to factory settings. I currently have the iOS 6.1.3 software update, I have 0.99 GB of Audio, 1.65 GB of Photos, 1 GB of Apps, 0.02 G

  • Links not working correctly in PCUI for CRM

    Hi All, We are implementing mySAP CRM 4.0 through PCUI on Portal EP6 SP14. I have integrated the CRM Business Package 60.2 in Portal. Proper User has been created in the backend and assigned Sales Manager Role both in the portal and in the CRM backen

  • Thin white border showing

    Hi all, when I have a document filling the screen (i.e. click ctrl+0) there is a thin white border surronding the image (see attachment). This does not show at any other magnification. Not happened in any other PS iteration (long word!) Can anyone te

  • Dear All, I am running Creat Autoadjustments, but program ends with error.

    Your kind help will be appreciated... Oracle Receivables: Version : 11.5.0 - Development Copyright (c) 1979, 1999, Oracle Corporation. All rights reserved. ARXAAP module: AutoAdjustment Current system time is 26-JUL-2012 09:44:17 Starting ARXAAP prog