How to upload image from a folder thro JSP

Hi,
I am CBK Varma,and I am developing one application, where
I have to display images in my webpage, from a specific folder that should keep on changing every 10 sec.. ...
how to upload these image files to my page with timing..means afterr 10 sec ,the another image in the same folder has to be dis[play.
I am storing images ina folder as .jpg/.gif format. (thro Java Program).
Plz tell me the way of how to do this?
Thanks in advance.
Varma.

These image files reside on the client? If so the client is going to have to initiate the upload. Think of the security problems if they didn't?

Similar Messages

  • How to load image from a folder to HTML page

    Hi frds,
    It's Very Urgent.
    I'm doing Visitor Management System Project.Regarding that,I get all personal details from Visitor and i used web cam for capture the visitor photo.That photo stored in folder.Actually what is my Question is?.How to fetch the photo from that folder even "Submit" button click.Is it any possible for fetch the photo which is captured as last photo.That means photo fetch by Time sequence.

    The photo is stored on the visitor's local computer?
    If this is the case, the only real way to get it to your server through a webpage is to use a file upload control. This means the user has to select the photo manually before he presses the submit button.
    Check out the "file" input field, which is a standard HTML control.
    It's Very Urgent.Some friendly advice, the next time do not mention this. People here do not care that your problem is urgent, in fact it will make them less likely to answer your question.

  • How to view images from Pictures Folder using iPhoto?

    Right now when I click an image in the Pictures folder, the image is automatically opened using Preview. I want to view images directly from my Pictures folder, and have them open to iPhoto. Is that possible?
    I just want to be able to view/sort my photos by Folders rather than by Events, Titles or Photo dates. I can't seem to get them to sort by folders in iPhoto.

    Iphoto is a Photo Database designed to allow you to organise and manipulate you photos without recourse to your files.
    It's not an image viewer, it can only work with photos that have been imported to the database.
    I just want to be able to view/sort my photos by Folders rather than by Events,
    An Event is a folder of images with a fancy icon. You can organize your pics in iPhoto anyway you want, using Albums, folders, keywords and so on. It's far more flexible that using folders in the Finder.
    You can opt to organise the files yourself, rather than have iPhoto do it for you, but I don't recommend it.
    Simply go to iPhoto Menu -> Preferences -> Advanced and uncheck 'Copy Files to the iPhoto Library on Import'.
    Now iPhoto will not copy the files, but rather simply reference them on your HD. To do this it will create an alias in the Originals Folder that points to your file. It will still create a thumbnail and, if you modify the pics, a Modified version within the iPhoto Library Folder.
    However, you need to be aware of a number of potential pitfalls using this system.
    1. Import and deleting pics are more complex procedures
    2. You cannot move or rename the files on your system or iPhoto will lose track of them on systems prior to 10.5 and iPhoto 08. Even with the later versions issues can still arise if you move the referenced files to new volumes or between volumes.
    3. Most importantly, migrating to a new disk or computer can be much more complex.
    Always allowing for personal preference, I've yet to see a good reason to run iPhoto in referenced mode unless you're using two photo organisers.
    If disk space is an issue, you can run an entire iPhoto Library from an external disk:
    1. Quit iPhoto
    2. Copy the iPhoto Library as an entity from your Pictures Folder to the External Disk.
    3. Hold down the option (or alt) key while launching iPhoto. From the resulting menu select 'Choose Library' and navigate to the new location. From that point on this will be the default location of your library.
    4. Test the library and when you're sure all is well, trash the one on your internal HD to free up space.
    If you're concerned about accessing the files, There are many, many ways to access your files in iPhoto:
    *For Users of 10.5 and later*
    You can use any Open / Attach / Browse dialogue. On the left there's a Media heading, your pics can be accessed there. Command-Click for selecting multiple pics.
    Uploaded with plasq's Skitch!
    You can access the Library from the New Message Window in Mail:
    Uploaded with plasq's Skitch!
    *For users of 10.4 and later* ...
    Many internet sites such as Flickr and SmugMug have plug-ins for accessing the iPhoto Library. If the site you want to use doesn’t then some, one or any of these will also work:
    To upload to a site that does not have an iPhoto Export Plug-in the recommended way is to Select the Pic in the iPhoto Window and go File -> Export and export the pic to the desktop, then upload from there. After the upload you can trash the pic on the desktop. It's only a copy and your original is safe in iPhoto.
    This is also true for emailing with Web-based services. However, if you're using Gmail you can use iPhoto2GMail
    If you use Apple's Mail, Entourage, AOL or Eudora you can email from within iPhoto.
    If you use a Cocoa-based Browser such as Safari, you can drag the pics from the iPhoto Window to the Attach window in the browser.
    *If you want to access the files with iPhoto not running*:
    For users of 10.6 and later:
    You can download a free Services component from MacOSXAutomation which will give you access to the iPhoto Library from your Services Menu. Using the Services Preference Pane you can even create a keyboard shortcut for it.
    For Users of 10.4 and later:
    Create a Media Browser using Automator (takes about 10 seconds) or use this free utility Karelia iMedia Browser
    Other options include:
    1. *Drag and Drop*: Drag a photo from the iPhoto Window to the desktop, there iPhoto will make a full-sized copy of the pic.
    2. *File -> Export*: Select the files in the iPhoto Window and go File -> Export. The dialogue will give you various options, including altering the format, naming the files and changing the size. Again, producing a copy.
    3. *Show File*: Right- (or Control-) Click on a pic and in the resulting dialogue choose 'Show File'. A Finder window will pop open with the file already selected.
    You can set Photoshop (or any image editor) as an external editor in iPhoto. (Preferences -> General -> Edit Photo: Choose from the Drop Down Menu.) This way, when you double click a pic to edit in iPhoto it will open automatically in Photoshop or your Image Editor, and when you save it it's sent back to iPhoto automatically. This is the only way that edits made in another application will be displayed in iPhoto.
    Regards
    TD

  • How to upload images from phone to itunes

    how do i upload photos and songs from my phone after the computer has had a master reset and wants to delete all the info off of the phone when  i try to upload anything?

    Purchases can be transfered. As far as other content, do you not have a backup?
    http://support.apple.com/kb/HT1848

  • How to get image from MIME folder

    Dear Experts!!
    I am doing the WebDynpro Exercise on /docs/DOC-8661#22 [original link is broken] [original link is broken].
    I put the images files to be shown with the UI elements in srcmimesComponents<package folder> in my workplace, gave the source of the pictures in the layout setting of the UI elements.
    However, I am not getting the images in the UI elements.
    I want some hints on the place to put the image files.
    I have put the images in the above mentioned folder  of the workplace, but when I check the navigation view of the project, I cannot see those imagefiles in srcmimesComponents<package folder>.
    Thanks in advance for your suggestions.
    regards,
    sudeep

    Hi Sudeep
    The procedure you are following in copying the images into src\mimes\Components\<package folder> is absolutely correct, but you are saying that you are not able to see those in navigation tab, then do one thing . directly nagivate through the 
    src\mimes\Components\<package folder> in your navigation tab and try to paste in image there only.
    remember one thing. the image name is CASE SENSITIVE . and you need to specify the extension along with the image name in the SOURCE property of the ImageUIElement.
    CLOSE YOUR PROJECT AND REOPEN THE PROJECT . and then go through navigation tab and see. now you can see those images
    Best Regards
    Chaitanya.A

  • Uploading images from PE6

    I will learn this yet. Can anybody tell me how to upload images from PE6 to a stock photography web site.

    Hi dongieux!
    Thanks for posting.
    In the left margin of ImageBrowser EX, select the folder containing the images.  Then, hold the CTRL key and click on each image you want to upload to select it.  After they are selected, click on the Canon Image Gateway button at the time, then Upload Images.
    Did this answer your question? Please click the Accept as Solution button so that others may find the answer as well.

  • How to upload image using JSP

    hi,
    i am confronting a problem how to upload image from local PC to web server . I am using Tomcat 4.0
    please help me by sending code
    thanks

    Hi,
    Here is the solution for uploading images and displaying images. I am using struts with JSP, so this code has a Action and ActionForm class. You can put the same code in Java Beans or Servlet class to run it. This code has two JSP files - one for Upload (upload.jsp)and other for Image(image.jsp) display. It has a Servlet also to display the image. Here is the code file wise.
    Upload.jsp **********************************************************
    <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
    <%@ taglib uri="/WEB-INF/struts-template.tld" prefix="template" %>
    <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
    <html:html>
    <head>
    <title>New Page 1</title>
    </head>
    <body>
    <html:form action="uploadAction.do" enctype="multipart/form-data" method="POST">
    <p>File to upload   
    <html:file property="fileUpload" size="20"/></p>
    <p><html:submit value="Upload" property="upload"/></p>
    <p> </p>
    <p><html:img src="image.jsp"/></p>
    <p> </p>
    </html:form>
    </body>
    </html:html>
    Image.jsp*****************************************************************
    <jsp:useBean id="upload" class="uploadtest.uploadActionForm" scope="session">
    </jsp:useBean>
    <%
         byte[] rgb=(byte[])session.getAttribute("byte");
         request.setAttribute("byArr", rgb);
    %>
    <!--
    The image data is now on the request object.
    Forward the user to the showImage servlet.
    That servlet will process and display the image data contained on the request object.
    -->
    Image is<p>
    <jsp:forward page="/showimage" />
    Struts Action Class - UploadAction.java **************************************************
    import javax.servlet.http.*;
    import java.io.*;
    import org.apache.struts.upload.FormFile;
    import org.apache.struts.action.*;
    public class uploadAction extends Action {
    public ActionForward execute(ActionMapping actionMapping, ActionForm actionForm, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) {
    uploadActionForm upload = (uploadActionForm) actionForm;
    try {
    int size=upload.getFileUpload().getFileSize();
    //if (image != null) {
    byte[] byteArr = new byte[size];
    //Create an input stream to read the uploaded file.
    ByteArrayInputStream bytein = new ByteArrayInputStream(upload.getFileUpload().getFileData());
    // Load the input stream into the byte Array.
    bytein.read(byteArr);
    // Close the input stream.
    bytein.close();
    // Load the byte[] into the content field.
    upload.setContent(byteArr);
    HttpSession ses=httpServletRequest.getSession();
    ses.setAttribute("byte",byteArr);
    return actionMapping.findForward("success");
    } catch (Exception ex) {
    ex.printStackTrace();
    return actionMapping.findForward("success");
    Struts ActionForm class ---uploadActionForm.java***************************************************
    package uploadtest;
    import org.apache.struts.action.*;
    import org.apache.struts.upload.*;
    import javax.servlet.http.*;
    public class uploadActionForm extends ActionForm {
    private FormFile fileUpload;
    private byte[] content;
    public FormFile getFileUpload() {
    return fileUpload;
    public void setFileUpload(FormFile fileUpload) {
    this.fileUpload = fileUpload;
    public byte[] getContent()
    return content;
    public void setContent(byte[] theFile)
    this.content = theFile;
    public ActionErrors validate(ActionMapping actionMapping, HttpServletRequest httpServletRequest) {
    /**@todo: finish this method, this is just the skeleton.*/
    return null;
    public void reset(ActionMapping actionMapping, HttpServletRequest httpServletRequest) {
    Servlet to display image --- ShowImage.java ********************************************************
    import java.io.*;
    import java.util.*;
    public class ShowImage extends HttpServlet {
    //Initialize global variables
    protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
    byte[] rgb = (byte[]) request.getAttribute("byArr");
    if (rgb != null)
    response.setContentType("image/gif");
    OutputStream stream = response.getOutputStream();
    stream.write(rgb);
    else
    response.setContentType("text");
    response.getWriter().write("attribute byArr not found");
    This code will enable to to upload and display the image. If you know Struts, then you can write the Struts-Config.xml file by yourself. Other wise write to me, I will send you that. If you want to save the image in database, then you have to keep it as BLOB datatype is database. For database you need to send the byte array in the uploadAction.java file to database. Database will keep the image as binary.
    Thanks
    Amit

  • How to delete images from folder which are not in the database

    I am created windows form
    i wont to delete images from the folder where i have stored images but i only want to delete those images which are not in the data base.
    i don't know how it is possible . i have written some code
    private void button1_Click(object sender, EventArgs e)
    string connectionString = "Data Source";
    conn = new SqlConnection(connectionString);
    DataTable dt = new DataTable();
    cmd.Connection = conn;
    cmd.CommandText = "select * from tbl_pro";
    conn.Open();
    SqlDataAdapter da = new SqlDataAdapter(cmd);
    da.Fill(dt);
    int count = Convert.ToInt32( dt.Rows.Count);
    string[] image1 = new string[count];
    for (int i = 0; i < count; i++)
    image1[i] = dt.Rows[i]["Image1"].ToString();
    string[] image2 = new string[count];
    for (int i = 0; i < count; i++)
    image2[i] = dt.Rows[i]["Image2"].ToString();
    var arr = image1.Union(image2).ToArray();
    string[] arrays;
    String dirPath = "G:\\Proj\\";
    arrays = Directory.GetFiles(dirPath, "*", SearchOption.AllDirectories).Select(x => Path.GetFileName(x)).ToArray();
    int b= arrays.Count();
    for (int j = 1; j <= b; j++)
    if (arrays[j].ToString() != arr[j].ToString())
    var del = arrays[j].ToString();
    else
    foreach (var value in del) // ERROR DEL IS NOT IN THE CURRENT CONTEXT
    string filePath = "G:\\Projects\\Images\\"+value;
    File.Delete(filePath);
    here error coming "DEL IS NOT IN THE CURRENT CONTEXT"
    I have to change anything .Will It work alright?
    pls help me
    Sms

    Hi Fresherss,
    Your del is Local Variable, it can't be accessed out of the if statement. you need to declare it as global variable like below. And if you want to collect the string, you could use the List to collect, not a string.  the string will be split to chars
    one by one.
    List<string> del=new List<string>();
    for (int j = 1; j <= b; j++)
    if (arrays[j].ToString() != arr[j].ToString())
    del.Add(arrays[j].ToString());
    else
    foreach (var value in del)
    string filePath = "G:\\Projects\\Images\\" + value;
    File.Delete(filePath);
    If you have any other concern regarding this issue, please feel free to let me know.
    Best regards,
    Youjun Tang
    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 can I import selected images from a folder instead of the whole folder in iPhoto 9.5.2?

    Hi there,
    I was trying to help my parents import some photos from a folder they have created with photos from their holiday. They only want to import select images from this folder into iPhoto. I said it would be easy and they can do it in 2 ways. First, they can drag and drop selected photos from their folder into iPhoto - and this works for them. However, more convieniently, they can click file>import to Library and then select the photos they want by going into the folder... Well that's how it works on my iPhoto '11 at least. When they showed me their screen via Skype (they are running iPhoto 9.5.2), when they click import to library, and try to go into the folder containing their photos, it imports the whole thing and there appears to be no way that they can enter the folder to select just a few photos from what I could see.
    Does anyone know anything aout this problem?
    Cheers.

    What view are using in the Import dialogue. Column view might be easiest to navigate.

  • How to read and show images from a folder in panel

    HI
    I have pre uploaded images in a folder in app server. In a page when user clicks on a button i need to show these images in a popup. when user selects any image i need to get the selected image name show it in the base page and close the popup. Need to save the image name in the database. Can you please tell me how to approach?
    Thanks
    Satya

    Hi,
    you can create a List and iterate it. instead of dialog another solution is to use a carousel component
    http://adfblogs.blogspot.com.es/2011/03/how-to-use-carousel-component.html

  • How do i load images from a folder?

    Hello everyone,
    Please can someone help me as i am stuck.
    I am trying to research loading images from a folder called /images/unknown (unknown is a customer number and is stored in a variable called customerNo).
    I feel that i will need to load the images into an array then display them to the screen with a viewer.
    Can anybody help me.
    Thanks in advance

    Welcome to the Sun forums.
    irknappers wrote:
    ...Please can someone help me as i am stuck.You might want to be more exact in future, about what you are stuck on.
    import javax.imageio.ImageIO;
    import java.io.FileFilter;
    import java.io.File;
    import javax.swing.JFileChooser;
    class LoadImages {
        public static void main(String[] args) {
            String[] suffixes = ImageIO.getReaderFileSuffixes();
            FileFilter fileFilter = new FileFilterType(suffixes);
            File directory = null;
            if (args.length==1) {
                directory = new File( args[0] );
            } else {
                JFileChooser fileChooser = new JFileChooser();
                fileChooser.setFileSelectionMode( JFileChooser.DIRECTORIES_ONLY );
                int result = fileChooser.showOpenDialog( null );
                if ( result == JFileChooser.APPROVE_OPTION ) {
                    directory = fileChooser.getSelectedFile();
                } else {
                    System.err.println("Must select a directory to proceed, exiting.");
            File[] images = directory.listFiles( fileFilter );
            for (File file : images) {
                System.out.println(file);
            System.out.println( "The rest is left an exercise for the reader.  ;-)" );
    class FileFilterType implements FileFilter {
        String[] types;
        FileFilterType(String[] types) {
            this.types = types;
        public boolean accept(File file) {
            for (String type : types) {
                if ( file.getName().toLowerCase().endsWith( type.toLowerCase() ) ) {
                    return true;
            return false;
    }

  • How to upload image files in sqlserver from jsp

    hi friends,
    i want to upload images to sqlserver how will i store url of the image or dorectly store the file in binary format, if we store in related path,plese give some ideas on store that paths in data base and how we store that image files in user directories.
    bye

    hi jay , I know that concept , but i dont know how to upload image files to server Please help me
    here i am giving my problem
    If any user register with site, he has the option to upload his image to the site, so i am using in html file upload option, But i dont know how to store that iamge into the server
    please give me suggestion
    regards
    sudhakar

  • How to Drag a image from a folder and drop it into Photoshop, InDesign using keyboard?

    Hi!
    Others may think silly about this question but the reality is I have to drag and drop several images into InDesign from a folder each one by one. Is it possible to drag and drop images from desktop (folder) to Adobe InDesign, Photoshop, etc?
    Thanks!
    Hope a positive reply.

    Thanks Peter/Jongware
    I searched Google and found the link below but became unable to use 'drag and drop'
    http://www.knowledgesutra.com/forums/Keyboard-Mouse-t49017.html
    I'm using Windows 7 Ultimate.
    Thanks.

  • How to move images from Picasa to Lightroom 5 on a mac?

    How to import images from Picasa to Lightroom 5 on a mac?

    Hi, lnmyers,
    I have thousands of pictures stored in Picasa, all of which are stored in my Picasa Web Albums. They are no longer in a directory on my hard-drive, that particular hard-drive having died ages ago. Thank goodness I uploaded them to Picasa's cloud before the hard-drive died. Should that ever darken, I am in trouble. I digress. I downloaded the pictures I wanted from Picasa Web Albums to my new external hard-drive that I set up and attached to my mac. For example:  I had a an album called "California 2013" stored in the Picasa cloud. I downloaded the entire album to a folder on my Seagate external drive that I call Lightroom within which I have a folder called California 2013. It took about twenty minutes to get them all (300+ photos). Then, I pointed LR to the California 2013 folder on the Seagate external drive when I wanted to catalogue the pictures into LR. I did not worry about metadata; I took whatever came with the pictures and didn't worry about it. I added copyright, keywords, and ownership info with LR. 
    I hope that helps.

  • How to upload photos from computer to camera memory card?

    I want to copy a few select photos and AVI files from the Organizer back to a new camera memory card.

    A new message was posted by Colin Walls:
    how to upload photos from computer to camera memory card:
    Open Organizer. Then open Windows Explorer [My Computer] and navigate to the memory card "drive." Drag the images from Organizer to the memory card.
    Dear Colin Walls:
    Thanks for your excellent tip. It works just as you said. The WHY I want to do this is:
    when I want to print a lot of pictures, I take my memory card to Longs Drug store and use their "machine." Naturally, I want to have all the photos I need on the card.
    A few days ago at Longs, I edited about 75 photos of a recent family reunion from my 512MB SD card taken with my Canon PowerShot A510. I ended up ordering 198 4x6 prints. My daughter had several good reunion photos on her digital camera. She e-mailed me seven photos as attachments, thus they were on my computer, but not on my memory card, until I started dragging as per the hint from Colin Walls.
    Windows Explorer shows the file structure on the card as one DCIM folder, with subfolders 155 CANON, 156 CANON, 157 CANON, 158 CANON, and CANONMSC. I proceeded to drag each my daughter's seven photos from PS Elem. 4 Organizer to the folder 158 CANON, except that I dragged one to the folder CANONMS, by mistake.
    The good news is that Longs machine and PS Elem. 4 both see ALL the photos on the card. The bad news is that my camera does not see the added photos, nor does the Canon ZoomBrowser 3.2 and 5.5 programs,nor the Picasa2 program.
    Thanks Colin. Gary Docherty

Maybe you are looking for

  • Ant Scripts works fine in one but fails in other environment

    Hi, Ant script is working fine in Dev environment but is failing in the other environment. Somehow the BPEL server is not able to pick the latest deployed process , due to this the dependent BPEL processes are failing. If we restart the server , it m

  • IPad 2 unresponsive except DFU mode, iTunes won't restore

    Let me preface: the steps to resolve the issue I have provided on the Apple website did not work, please do not suggest them. Yesterday I received my replacement iPad 2 in a brand new sealed box after about a month of waiting and shipment issues.  Ou

  • Not seeing content in mail folders

    I use default mail with a hotmail account.  I have folders but none of the messages appear when you click on a particular folder.  When I use my PC you can see info in the folders.

  • New to Lightroom 5

    I just downloaded lightroom 5...never used it.  How do you save a fixed photo?

  • Perverse behaviour of LR 3.4.1 on photo import

    After updating to 3.4.1 import seems to behave differently. It is perverse, counter-intuitive and frustrating (and almost certainly a user error!). Could somebody volunteer to help reduce my blood pressure? Since the first LR beta in 2006 I have arra