Image uploading and saving to database

hi ,
           I am developing application for summer placement . i want to upload image with candidate'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  candidate's details.
Kavita

Hi kavita,
               In Webdynpro u r using attribute of type Resource ,which is binded to FileUpload UI element. From this attribute, u get file in Input stream format which can be converted into byte array like this
byte fileData[] = null;
      try{
            InputStream fileIs = wdContext.currentFile().getFileData().read(false);
            ByteArrayOutputStream bOut = new ByteArrayOutputStream();
            int length;
            byte[] part = new byte[10 * 1024];
            while ((length = fileIs.read(part)) != -1) {
                  bOut.write(part, 0, length);
            fileIs.close();
            fileData = bOut.toByteArray();
            bOut.close();
      } catch (Exception e) {
            wdComponentAPI.getMessageManager().reportSuccess(e.toString());
In webservice u can take a the byte array as input parameter where the uploaded file will be passed as byte array .
In DB u can store it as BLOB .
in case of any other doubt u can revert back to me.
regards
Sumit

Similar Messages

  • Image upload and display from database blob coloumn in ADF

    HI
    how can i upload and display image from database ( blob ) coloumn in ADF

    Hi,
    Take a look to this video: http://www.youtube.com/watch?v=_KYquJwYFGE
    AP

  • Multiple Image Upload with save to database not working in IE anymore

    Since updating IE to SP3 ADDT Multiple Image Upload with save to database does not work anymore in IE. It will show a regular file upload field, an does not allow selection of multiple files. It does work in Firefox, but not all my clients use firefox.
    PSE Advice.

    I would consider buying some pluggins from dmxzone.com. They
    may cost a
    bit upfront but in the long run, you've probably be saving a
    lot of
    headaches.
    http://www.dmxzone.com/
    If time's an issue, with these plugins, you could probably
    be up and
    running in a half hour. George has some really nice pluggins
    for
    Dreamweaver and well worth the money.
    Peter Raun wrote:
    >
    I am going crazy here
    > I will see if i can explain my problem here. . .
    > I am trying to use the multiple image upload with save
    to database function in
    > the developer toolbox, and it work just fine, it lets me
    select where to store
    > the filename in database and where i want to save the
    actual image on the
    > server. It is wery easy to use if you just want these
    functions.
    > But i would also like to give every image a gallery id
    in the database, so i
    > can sort them out afterwards, its not whery smart to
    upload a lot of images to
    > a folder, and in the database you just have an image id
    and an filename, i cant
    > sort them into galleries with these to collums. . . . So
    i guess i have to do
    > something with the "additional fields" when i am
    creating the server behavior
    > but i cant figure out what to do?? i would have liked if
    i could have made an
    > list/menu with all of the availible galleries, and chose
    the one that i whould
    > add images too and then that gallery id whould be added
    to those images in the
    > database.
    > I have also tried to pass on an url parameter and then
    use that as a default
    > value in the "additionel field" section but without any
    luck at all. . . I hope
    > someone here has an idea, that could help me out. . .
    > It is sooooo easy to do this, when you are uploading ONE
    image at a time, i
    > cant figure out why it has to be sooooo hard when using
    "multiple image
    > upload"
    >

  • Multiple image upload with save to database problem

    I am developing some backend work for a client, and we recently used the Multiple image upload with save to database wizard without a problem. A few days later, we noticed that we could only upload a single file at a time - it seems that the coding is no longer able to access the flash part of this and is using the javasript function instead. I know the web hosting company has made some changes on the server, and I did some reearch and it seems that  there could be an issue with Flash 10, but has anyone else experienced anything like this? Any help is greatly appreciated.
    Thanks.
    Jeremy

    Thank you for the responses. I have already updated awhile ago, so I am wondering what happened. Not sure if during the server update, some files were replaced (unless I totally forgot to update to 1.0.1 on this site). So I reinstalled 1.0.1, deleted the includes folder from the server and uploaded my includes folder and it now works again.
    Again, thanks for the help.
    Jeremy

  • Multiple image upload with save to database wizard problem

    hi,
    i need to upload multiple images (6) in a table called pictures. i will need the names stored in the database and the files uploaded on the server. since i am new to dreamweaver i can not figure out on how to make this work.
    the multiple image upload wizard uploads the images fine and creates a subfolder with the right id but i have no file names in the database at this point. i tried the multiple image upload with save to database wizard but i only get one upload button. it worked fine with one image but i need 6 pics uploaded. the i tried to first upload the pictures with the multiple image upload wizard and use the update wizard to add the names afterwards but that did not work either. hmm. would be great if someone could help me out.
    thanks, jan

    Thank you for the responses. I have already updated awhile ago, so I am wondering what happened. Not sure if during the server update, some files were replaced (unless I totally forgot to update to 1.0.1 on this site). So I reinstalled 1.0.1, deleted the includes folder from the server and uploaded my includes folder and it now works again.
    Again, thanks for the help.
    Jeremy

  • Multiple Image upload with save to database

    Hi everyone,
    I wonder whether anyone can help me, I have been trying to use the multiple image upload with save to database wizard. When I create the page and upload it and then view it in Safari the only thing that is on the page is an upload button. When I press the upload button I am able to browse my files and select them. When this window closes a flash loading value is shown but no images have been uploaded.
    Am I missing anything? I have had no problems uploading single files and creating albums. I want to create an online gallery so that I can do a multiple upload to a specific album if this is possible.
    Cheers
    Sarah

    Hi Sarah,
    >>
    but only the filename appeared in the database and no other information was stored.
    >>
    that´s how it´s been designed also in the "single upload" -- the path_to_the_folder where the files sit in have to be determined elsewhere
    >>
    {wedimg_idalb}
    >>
    I don´t see any reference to this "dynamic data" placeholder in any of your table columns you posted -- where does this one come from ?
    >>
    1. I have multiple clients and each client has their own set of images.
    2. Each set of client images must be linked to an album via the album ID
    >>
    do you have any "foreign key" which is related to the user_table´s ID in order to make user ID 2 upload his images in album ID 2 ? How will the upload page "know" where the images are going to be uploaded to ?
    >>
    and the album page, wedding_alb
    >>
    to my mind *this* table would itself need a foreign key to the user_table in order to "map" record 2 to user ID 2 -- or do I miss something ?
    Günter Schenk
    Adobe Community Expert, Dreamweaver

  • Image upload with save to database

    Quick question guys,
    Can Image upload with save to database be added to an existing form in order to save other info as well as the file name to the database.
    Thanks
    Col F

    Hi,
    Not looking at any code you have an upload button for the video and an insert for the form. So both forms are independent of each other it looks like, thats why when you do one you only get that info and when you do the other you only get the other info. You should just make one form with the uploader included. Make one form with all the fields included (movie name, movie page, movie description, movie file) after the form is completed then select the file field and go to...
    Server Behaivoirs, Developer Toolbox, File upload, upload file. Follow the widgets.

  • Image Upload and Resize Trigger Order Question

    Hello All,
    I do enjoy and like using the ADDT, however I do have a problem with the Image Upload and Resize trigger.
    I understand that this trigger is of the AFTER type, and as such, the insert record I have on the page is implemented first and the data is inserted into the table, then images uploaded provided they are smaller than 200 kB in size.
    However, as I have a field that is unique in the database, if the upload fails I am unable to upload any files which are under the size and put that information into the database, as there is already a record with the unique value.
    Is there an easy way to work around this by trying to capture the error before the data is inserted into the database?
    An idea I have is to: check the unique field with the value to be inserted, if fails, change unique value -> nothing inserted yet, no files uploaded.
    If the unique check passes, insert remaining data and trigger the upload and resize image trigger, once that is complete, have an update of the table to update with the unique value.
    I can see the above working, (I think), but I just have to write the code to implement the idea.
    I am not sure how to use the roll-back triggers either, if the Upload Image trigger fails, to remove the inserted record.  But if I can manage the roll-back trigger to remove the record, that is an option to consider for what I want to achieve.
    Thanks to any help people can provide.
    Cheers,
    Ian.

    Thank you for your reply.
    I have a work-around, I have split the forms over two pages, rather than put everything on one page - which introduced another issue, to which I have made a work-around of sorts too.
    The two forms, on different pages, is probably a better idea in terms of better management of data input. The work-around was a Header redirect based on a form variable, as, if I used a Custom Trigger to dynamically generate a new URL, it generated an escaped-encoded URL - to which I have not figured out how to fix.
    So, in the meantime, it works, so I will settle for that at the moment.
    Again, thanks for you reply.
    Ian.

  • My contacts from my iphone 4S are not being uploaded and saved to iCloud.

    Why are the contacts that are on my 4S iphone NOT being uploaded and saved to iCloud contacts?  Yes, contacts toggle is turned to "on" on my phone.  Yes, I have updated manually while plugged in and connected to my WiFi as well as left it plugged in and locked to automatically update iCloud.  Still no contacts in my iCloud folder even though I have 379 contacts sitting on my phone.

    I'm no expert by far, but have had issues with this before.
    IMAP should allow your iPhone to remove messages from the server.
    But have you made sure both the iPhone and Outlook are connecting via IMAP?
    If your iPhone does remove the messages from the server, but your computer is using POP, then the computer may download the email before it is removed form the server by your iPhone.
    This was my issue, that my computer had already downloaded the message, and POP does not check later if it is deleted.
    If you delete a message from Outlook does it disappear on the iPhone?
    Alternativly you may need to check the email server settings.
    Who is your email provider?
    They may be able to check if IMAP allows you to remove emails.

  • Need help with image upload and preview display

    hi guys,
    I'm trying to upload image and then display it as a preview, but when upload form submits to the same page image placeholder does not refreshes it's source and displays the same image as before.
    Image 4.jpg already exists.
    I upload it with nameConflict = "overwrite"
    upload form points to the same page, therefore page reloads
    In IE image placeholder does not display the new image, but shows the old one until I refresh the page with F5 and resend information, however if checked, image in the file is already different.
    In Firefox, sometimes it works and image refreshes, sometimes not.
    any help would be greatly appreciated!
    cheers,
    Simon

    Hi Daverms,
    With your code you suggest to not only upload the image but make a database entry too. However my intention is to firstly upload the file, and show a preview. Then if user is satisfied with what he sees, he presses "aprove" button and therefore makes a datase entry. Then the photo number will increase by one.
    Until user is not aproving the photo he can upload any image again and again, but the new image will be always given the same name (example 4.jpg) and overwriting the old one.
    I believe the problem persists because browsers are loading image with the same name from the cache, and not from the actual location. Therefore when I refresh the page it catches the correct image.
    If I follow your code, every time I upload the image, name of it is different, therefore browser cannot find it in the cache and is forced to load one from the server.
    I wonder is there any way to avoid this cache problem?
    cheers,
    Simon

  • Upload and download from database

    i need to do a form to upload data in a blob field in the database and then have a link or smth simliar to download them..... any link or example wich can help me plss??? thanks in advance

    Hi Shay! i am not finding nothing about upload and download in a blob field in database ... in the link you sent me ... can you be more specific pls? thanks :=)

  • Picking up image drawan on panel into image object and saving itto file.

    hi dear friends,
    please help me out , My problem is:
    On challan generation screen we want to make provision for signeture.So for that purpose we have placed panel inside the frame where user can do the signeture.
    Signeture drawing is working .But now the next step is that i want to store it in a file(I mean to say whatever drawn on panel) so that that file can be saved in database and later on it can be retrived when ever required.
    will be thankful if anyone helps me.
    waiting for replays.

    try to use following code :
    BufferedImage im = new BufferedImage(comp.getWidth(), comp.getHeight(), BufferedImage.TYPE_INT_RGB);          
                             Graphics2D g2 = im.createGraphics();
                             //you may want to set background color, etc...     
                             comp.paint(g2);          
                             try          
                                  GIFEncoder gif = new GIFEncoder(im);
                                  gif.Write(new FileOutputStream(file));
                             catch(Exception e)          
    GifEncoder can be obtained from net. if u want i can mail u also.

  • Multiple Image Upload and watermarking

    Hi,
    I am using a gallery script which takes main images from a dynamic folder and creates thumbnails on the fly.
    It gets the main images dynamically from
    $config['fulls'] = $_GET['imgfolder_id'];
    Then GD is applied to create thumbnails on the fly. There is no GD role for the main images. I use lightbox to show pop-up image. And the images are uploaded to a dynamic folder using ADDT multiple image upload server behavior.
    My requirement: want to apply water mark on the large (pop-up) image. Not on the thumbnail.
    Is it possible to have the water mark applied at the time of Multiple Image Upload?
    Thanks for any help
    Jay

    Hi Jay,
    if it were a single image upload, I would have suggested to apply a PHP watermark script to the uploaded image by embedding that code in a Custom Trigger, type AFTER -- but as the multiple upload gets proceeded by a flash file, I have no clue how to do that.
    Cheers,
    Günter Schenk
    Adobe Community Expert, Dreamweaver

  • Want User Exist or BADI when PO created and saved in database

    Hello Experts,
        I want User Exists or BADI, when PO saved in database table. That is, after Successfully Created message, want user exist or BADI in 4.7 server.
    Thanks & Regards,
    Poonam.

    Hi Friend ,
    Here is the  User Exit & BADI for Purchase Order  on save .I hope it will solve your Query
    User exit  create project  in CMOD : MM06E005
    BADI in SE18 :  ME_PROCESS_PO_CUST
    For more Information please see this SDN LINK : [ME21N /  ME22N SAVE Userexit;
    Regards,
    Edited by: Loganathan girishkumar on Nov 5, 2009 4:31 AM

  • Raw Images opened and saved as TIFF of PSD in photoshop not added to LR library

    Images opening from LR to PS6 are opened as CR2 files (canon) and then saved in PS - the resulting saved images are PSD files. These files are not added to the LR catalog without re-importing them. This behavior is different than it was in CS5 - in CS5 they are opened as PSD and immediately added to the LR catalog. I want the same bahavior in CS6. In LR I have set preferences to open files as PSD but they are not PSD until they are saved in PS.

    The behaviour you are now seeing when using CS6 is normal when Lightroom and Photoshop are in sync in respect of the ACR level, i.e. the derivative PSD/TIFF is NOT created until you hit Save in PS. When the ACR levels are not in sync (i.e. the PS version is lower than the LR version, as is the case using LR4 and CS5) the "ACR Mis-match" dialog appears (though you may have ticked the "Do Not Show Me Again" box after selecting "Render Using Lightroom") and in that situation the derivative file is created by Lightroom, so you see it appear in LR before it is opened into PS. The fact that the filename that you see in CS6 shows the CR2 extension is not an issue (PS always retains the raw file's full name until it is saved as a derivative file....try opening a raw file directly into CS5/CS6 from outside Lightroom and you'll see), and it will change as soon as you select Save, at which point you should also see the PSD/TIFF appear in Lightroom.
    So the only question is, why are you not seeing it? Can you confirm that when you are done in PS that you are selecting "Save" and not "Save As"? And that Lightroom is still running when you do that? And what source are you working from: Folder, Collection, Smart Collection? When you import the PSD, is "Do not import suspected duplicates" cheched or unchecked?

Maybe you are looking for