Showing the thumbnail view of the uploaded image

Hello Experts,
I am developing a website in jsp, where i have a module for patron uploading their photo into the server.
After a lot of gooling and searches in this site, i found code to upload the image and it uploads perfectly into the specified folder at server also. But my need is showing the uploaded image at once, after the image is uploaded. i used
<img src="images\<%=filepath%>"> and also
<img src="ImageServlet\file=<%=filepath%>"> both are not working.
any suggession will be greatly appreciated.
Regards,
Sri.

Thanks for your suggessions, i have placed my code below, i think i am closing the file afrer writing.
If anything is failed to close, please let me know.
            if (request.getParameter("upload") != null) {
                String contentType = request.getContentType();
                if ((contentType != null) && (contentType.indexOf("multipart/form-data") >= 0)) {
                    DataInputStream in = new DataInputStream(request.getInputStream());
                    int formDataLength = request.getContentLength();
                    byte dataBytes[] = new byte[formDataLength];
                    int byteRead = 0;
                    int totalBytesRead = 0;
                    while (totalBytesRead < formDataLength) {
                        byteRead = in.read(dataBytes, totalBytesRead, formDataLength);
                        totalBytesRead += byteRead;
                    String file = new String(dataBytes);
                    String saveFile = file.substring(file.indexOf("filename=\"") + 10);
                    saveFile = saveFile.substring(0, saveFile.indexOf("\n"));
                    saveFile = saveFile.substring(saveFile.lastIndexOf("\\") + 1, saveFile.indexOf("\""));
                    String ext = "";
                    if (saveFile.indexOf(".") != -1) {
                        ext = saveFile.substring(saveFile.lastIndexOf("."));
                    int lastIndex = contentType.lastIndexOf("=");
                    String boundary = contentType.substring(lastIndex + 1, contentType.length());
                    int pos;
                    pos = file.indexOf("filename=\"");
                    pos = file.indexOf("\n", pos) + 1;
                    pos = file.indexOf("\n", pos) + 1;
                    pos = file.indexOf("\n", pos) + 1;
                    int boundaryLocation = file.indexOf(boundary, pos) - 4;
                    int startPos = ((file.substring(0, pos)).getBytes()).length;
                    int endPos = ((file.substring(0, boundaryLocation)).getBytes()).length;
                    if (ext.equalsIgnoreCase(".jpeg") || ext.equalsIgnoreCase(".jpg") || ext.equalsIgnoreCase(".gif") || ext.equalsIgnoreCase(".png") || ext.equalsIgnoreCase(".tiff")) {
                        String strFilePath = "";
                        String strCopyPath = "";
                        Properties props = new Properties();
                        try {
                            File filDBConfig = new File(strFilePath);
                            FileInputStream fiStream = new FileInputStream("C:\\sansri\\config.properties");
                            props.load(fiStream);
                            strFilePath = props.getProperty("db.photopath");
                            strCopyPath = props.getProperty("db.copypath");
                            fiStream.close();
                            filDBConfig = null;
                        } catch (Exception e) {
                            e.printStackTrace();
                            Photo = "Invalid File";
                        System.out.println("strFilePath " + strFilePath);
                        File fff = new File(strFilePath);
                        if (fff.exists() == false) {
                            fff.mkdirs();
                        fff = new File(strCopyPath);
                        if (fff.exists() == false) {
                            fff.mkdirs();
                        //copying into build to show uploaded image at once
                        Photo = request.getParameter("upload").concat(ext);
                        FileOutputStream fileOut = new FileOutputStream(strFilePath + "\\" + Photo);
                        fileOut.write(dataBytes, startPos, (endPos - startPos));
                        fileOut.flush();
                        fileOut.close();
                        //copying into web also to avoid unavailability of image while rebuilding
                        fileOut = new FileOutputStream(strCopyPath + "\\" + Photo);
                        fileOut.write(dataBytes, startPos, (endPos - startPos));
                        fileOut.flush();
                        fileOut.close();
                    } else {
                        Photo = "Invalid File";
            }{code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Similar Messages

  • How to display the thumbnail view of the documents in Sharepoint Document Library

    Is there a way that we can have the thumbnail view of the documents that are uploaded in SharePoint Document Library. We have thumbnail feature in Picture Library but can we have the same in Document Library too. Documents includes Words,Excel,PDF.
    Any Suggestions Please 

    Hey Mike,
    Good post, I'd be curious to see if anyone has used the GD Picture SDK with SharePoint, maybe there would be some sample code.
    Hey Kukdai,
    Developing your own solution would potentially provide a better way to accomplish your task, but before setting out on that long road you may want to try the simple customization, it's less time consuming and it will help gauge your customer's interest and
    support.
    Also, there is a wealth of open source code for SharePoint available on CodePlex, you might want to check that out as well.  Here is the linK:
    http://www.codeplex.com/
    Also, here is an interesting project to consider for your task:
    http://enhancedpicture.codeplex.com/
    I hope that helps!
    Tom Molskow SharePoint Architect - If I solved the issue please propose my reply as the answer - Thanks!

  • How do I change my PDF files on my desktop back to the THUMBNAIL view & not the adobe icon?

    How do I fix this problem ?  When I turned on my laptop yesterday all my PDF files on my desktop have changed from the thumbnail view (which I need) to the adobe icon ?  I don't know why it changed ?  But I'm having major problems trying to change it back....!!!  Can anyone help me please ??
    I'm using a PC & I use Windows 7

    Please don't post the same question mutliple times!  I have deleted your duplicate post.
    Have you tried a System Restore to a time before the change occurred?

  • How can i see the previews of a folder's images from the Thumbnail View?

    I mean, in windows XP if you set the Thumbnail View, inside the icon of the folder you can see the preview of the images inside ( like this http://mowd.idv.tw/LonghornPDC/folder_preview.JPG )...
    Is there a way to do it on Mac OS X? Maybe some plug-in, some file manager: anything...i often have to check out thousands of photos to find the reference for an illustration, and it's pretty frustrating having to open up every folder...
    Thanks in advance
    iMac 24"   Mac OS X (10.4.9)  

    but none of these two options allows me to see a folder's images BEFORE opening it...
    You want to go back and try that again... just right click on the folder - you don't have to open it - and choose 'Show In PicturePopPro2'.
    Check out the icons on the menu bar - you can get a contact sheet view, move from shot to shot using the arrow keys... it'll do what you want.
    Regards
    TD

  • I want Preview to always show the thumbnails view!!!!!

    Latest build of preview, Mountain lion OS X
    When I open a PDF in Preview, it shows the Table of Contents view. I want Preview to always show the thumbnails view! Is there a way to change this to the default setting? (And dont say goto view - thumbnails, that's not a default option)Every time I pick a photo or PDF it starts with the Table of Contents view every time!

    This works but only when opening the same document. Other documents just default to the plain view.
    Big oversight - particularly when merging lots pdfs and each one has to be manually changed to thumbnail view. All becomes very cumbersome

  • Thumbnail view as the default setting.

    Two related questions. 
    1) How do I make Thumbnail view in the project panel the default setting for all/new projects?   I've set my workspace and keyboard arrangement as my custom layouts, but when I make a new project, it always defaults to list view.
    2) In a project I'm already using, when I load it up, it's loading up in list view where as in all old Premiere versions, it would load up as whatever the previous setting was.  Am I doing something without realizing it that's making it default back to list view?
    Thanks.

    It doesn't sound like you're doing anything wrong. And as far as I know, nothing's been changed in this regard in terms of expected behavior. So my first guess is that your preferences aren't getting saved properly. The first test I'd try is to launch PPro, change a pref that's easy to test like Show Tooltips, save/close/relaunch, and check whether tooltips are displayed--or simply go back into Preferences and see if the setting stuck.
    If that change to the prefs didn't take, then the next step is to clear the prefs by holding down the Alt key while you launch Pr.  Keep holding it down until you see the Welcome Screen pops up.

  • HT2506 Change the Thumbnail view in Preview (Mac)

    Hi everybody!
    I am wondering if there is the chance to change the thumbnails view  in order to display pdf pages on two or more columns, the same as in acrobat it is increasing or decreasing the size of the thumbnail window or zooming in/out in the same window.
    Thank you for your support!
    Best regards!

    Minimally, are you aware that Artists view has an Artwork Size slider under the View Options menu item?  These preferences stick with the application. 
    I mucked around for a while before I realized that View Options items change for each view.  Still smallish in the Artists right column at maximum, but better than nothing, and I would have expected to expand the graphics view all the way up to a full window in Albums view, which doesn't seem possible. 
    Also, I noted there doesn't seem to be a way to view full size album art other than selecting the art icon of the currently song, up at the top.  Still there under Get Info in the song record but I couldn't figure out how to view anything larger but through the icon at the top.  Not a big deal overall, but I have occasionally opened multiple album art and tiled them to check details side by side. 
    Alsoalso, I thought I could put the album art full screen like an audio slide show and blot out the background, but that seems to have disappeared.  Again, not that important to me, but odd. 

  • Safari is missing the thumbnail view icon.

    I just updated my iPad to iOS 5 and now Safari doesn't show the thumbnail view icon in either landscape or portrait?

    Yes, we want what we already had (wizard of oz style)....it's not about how it is, it's how it was (and isn't now). I wished they'd spent more time on trying to get the app store and the iBooks  store to remember where I was searching and not go back to page 1 after many, many pages!. Not waste their time on changing the whole kit and caboodle in a massive upgrade that gives us, original iPad/iPod users, something that we didn't want. What we had was fine...just needed a few tweaks and a few extras (maybe?)'not  a copy of a computer screen...that is way bigger to view in any case!

  • Unable to upload "filescopied_48862.txt" to update the current view of the

    Hi Team,
    While applying applications patch I am getting the below error in the patch log file.
    Start Processing Snapshot Info
    AutoPatch error:
    Unable to upload "filescopied_48862.txt" to update the current view of the snapshot.
    But when I checked in the ad_bugs table it is showing the bug_number.Actually this patch has to change the version of file fadp6.lpc,but it is not changing it.
    We already have updated current view snapshot.
    Please suggest me on this.
    Thanks,
    Suresh

    Hi Hussein,
    Thanks for quick reply and the details are:
    Q)Please post the application release, database version and OS.
    ApplicationRelease:R12.1.1
    Database Version:11.1.0.7
    OS:Windows Server 2008(32 bit)
    Q).What is the patch number?
    12338963
    Q).Is this the complete error message?
    In the whole patch log file this is the only error it is showing.
    Q).Did the patch continue to run after this error and completed successfully?
    Yes It has continued to run after this error and completed successfully.
    Q).Please apply the patch again from the beginning and see if you encounter the same issue.
    I have applied the patch again from the beginning and we are getting the same error.
    The only error in patch log file it is showing is:
    Start Processing Snapshot Info
    AutoPatch error:
    Unable to upload "filescopied_48862.txt" to update the current view of the snapshot.
    Q).What is the version of fadp6.lpc you already have? What is the version of fadp6.lpc delivered by this patch? Have you verified the timestamp of the file?
    fadp6.lpc 120.36.12010000.7 and the timestamp is:2009/07/28 07:55:40
    Version of fadp6.lpc delivered by this patch is:120.36.12010000.13
    Thanks,
    Suresh

  • The photos in my IPhoto have all become mini-thumbnails and I can't open or edit them. When I print the image it comes out normal size.  How do I get the thumbnails back to the standard size and be able to work with them?

    The photos in my IPhoto have all become mini-thumbnails and I can't open or edit them. When I print the image it comes out normal size.  How do I get the thumbnails back to the standard size and be able to work with the photo files?

    What version of iPhoto and system are you running?  On the guess that you're running the latest iPhoto, 9.4.2, Try the following:
    1 - launch iPhoto with the Command+Option keys held down and rebuild the thumnails, Option #2.
    2 - It may take 2-3 attempts so don't give up after only one attempt.
    OT

  • A gap between letters started to show in my indesgn files. tried to undo with tracking, the paragraph settings. nothing helped. it ruins the fluent view of the document. how can i restore the program so that doesn't happen?

    a gap between letters started to show in my indesign files. tried to undo with tracking, then with the paragraph settings. nothing helped. it ruins the fluent view of the document. how can i restore the program so that doesn't happen?
    for example: say i write a paragraph. then, in a weird some sort of way an involuntary gap suddenly appears between different letters of random words(i did not recognize any pattern to the gap appearing) throughout the entire paragraph. once i've double clicked on that paragraph, and made a minor change, lets say tapped a 'space' key, and then clicked ctrl+z to undo, it has aligned(or fixed) the entire paragraph and made it look ok again. i've tried numerous ways to undo the entire thing, but cannot find the reason. i've been working for a few years and there's no reason why this thing all of a sudden should happen right now.
    if anyone has stumbled on something like that and can advise, i would welcome it.
    MNS-KG
    Vadim

    yep...i'm typing with hebrew. i'll make a printscreen with the settings you've asked for@:
    if you look closely you'll see that almost every line has a single letter apart. in hebrew there is no usually a singe letter structured words.

  • When I open PS from LR to edit an image, the thumbnail appears in the side bar but the image area is white, PS CC 2014!

    Hi,
    I've just started a subscription for the Photographers package, when I open PS from LR to edit an image, the thumbnail appears in the side bar but the image area is white, I'm sure this is a stupid newbie mistake but I can't for the life of me see what I've done wrong.

    copernicus1952 wrote:
    the thumbnail appears in the side bar but the image area is white
    Are you referring the the multiple thumbnails in ACR side bar?  I don't use LR  but I do use  Photoshop and as far as I know Photoshop has no sidebar with image thumbnails.
    Supply pertinent information for quicker answers
    The more information you supply about your situation, the better equipped other community members will be to answer. Consider including the following in your question:
    Adobe product and version number
    Operating system and version number
    The full text of any error message(s)
    What you were doing when the problem occurred
    Screenshots of the problem
    Computer hardware, such as CPU; GPU; amount of RAM; etc.

  • Rearranging and duplicating pages in the thumbnails view?

    How do I rearrange and duplicate pages in the thumbnails view of pages? I could before, but can't with the new pages. DROPPING features?! That's not what an upgrade does! This hugely messes up my work!

    List of changes to Pages 5
    http://www.freeforum101.com/iworktipsntrick/viewforum.php?f=22&mforum=iworktipsn trick
    You should have Pages '09 in your Applications/iWork folder. Use that meanwhile.
    You can trash or archive Pages 5, and rate/review it in the App Store.
    Peter

  • There is no pic shown when someone calls me. Not even the thumbnail view. How to fix this?

    I just reset my iphone. Now there is no pic shown when someone calls me. Not even the thumbnail
    view on top right corner. How to fix this?

    Have you entered pics for contacts in your contacts?

  • This is a silly question, but I cannot fix it! The icons that appear on my photos after I edit them, have gone away. The only way I can see them is in the Grid view. How can I get the icons back on the thumbnail photos of the full gallery that is loaded?

    This is a silly question, but I cannot fix it! The icons that appear on my photos after I edit them, have gone away. The only way I can see them is in the Grid view.
    How can I get the icons back on the thumbnail photos of the full gallery that is loaded? TIA =)

    You have likely dragged the size of the filmstrip thumbnails to a small size that prevents Lightroom from displaying the badges. Using your mouse, mouse over the top line of the filmstrip and then drag it supports to increase the size.

Maybe you are looking for

  • How can I download google earth onto my iPad 2 if I'm based in Kenya?

    When I search fir it on the App Store Google Earth isn't the, but when I goggle it therebis an iPad app available. I'm based in Kenya and I'd like to know how I can I download it.

  • Samsung LN-S4051D HDMI Isssue

    Hello, I purchased this tv over two years ago, along wtih the 4 year protection plan.  Recently, my sister bought a Sony Blu-Ray player and I went to hook it up to my TV.  I currently use both of the HDMI ports (A Samsung HTIB/XBOX 360) and they work

  • Playing music from internet thru itunes

    can't find ip address for grateful dead radio from their website and how do i get it to play thru itunes

  • Multiple text docs evaluation

    hey everbody, i'm absolutely new to any sort of data management here it goes: suppose we store 100 .txt or .doc files in sql server and we want that none of the files data should match more than 60%: the question which arises are 1. how do we store f

  • Re-installing iMovie plug-ins

    When I switched from a PPC Mac to my Intel Mac, I had to update some third-party plug-ins for iMovie. I was having some problems with it and did something stupid. I removed the iMovie plug-ins in my library for transitions and titles and somehow lost