How to open local file or folder (a C:\ drive) in the browser

Hello

the use case is just to open a local address with a click of a button.
11.1.2.3 jdev
I try to open c: in the browser
on the page, I use a button print with the destination, the value file:///c:\
< af:goButton text = 'C: Browse' id = "gb1" targetFrame = "_parent" destination = "file:///c:\". "/ >
in fact, when I provide this URL directly in browse (file:///c:\), it opens fine.
I tried to use escaped without success...
What does take to open a local address with go button?

Published by: grodno on February 20, 2013 02:20

Hello
try following

     
                
          

public void download(FacesContext context, OutputStream out) {
        File f = new File("c:\\path\\a.txt");
        FileInputStream fis;
        byte[] b;
        try {
            fis = new FileInputStream(f);

            int n;
            while ((n = fis.available()) > 0) {
                b = new byte[n];
                int result = fis.read(b);
                out.write(b, 0, b.length);
                if (result == -1)
                    break;
            }
            out.flush();
        } catch (IOException e) {
            isErroroccured = true;
        }

    }

Tags: Java

Similar Questions

Maybe you are looking for

  • Re: Satellite L505-13W - hardware upgrade

    Hi all I specified modelhttp://www.Toshiba.EU/discontinued-products/satellite-L505-13W/ and I want to use the design program rhino3d v5. Minimum specifications of the program can be found here:http://www.simplyrhino.co.UK/rhinotraining/hardware.html

  • Disk capacity hard satellite 2550S

    Hello I wonder if Toshiba Dynabook Satellite 2550 S supports 40 GB HDD? If no, what is the maximum capacity of the hard drive can detect this laptop? Similarly, what is the graphics card for this device driver, I'm only using standard view type (disp

  • How will I know if I have a virus

    my bank online has just been compromised...

  • Cover the problem of crack on Satellite P100

    The external plastic of my laptop has started to crack near the hinges. I called Toshiba some time ago and they said that because it was just apparent defects, it was not covered by the warranty. However, it has gotten worse over time, the plastic pa

  • Photosmart 7515: Billboard empty on my Photosmart 7515

    The Billboard on my Photosmart 7515 is its vacuum suddenly. I can still prnt all documents, but the screen is blank. So I can't use other features like fax or adapting documents without the touch screen. Any ideas?