Download path conversion from / to _ help please

Using JDeveloper 11.1.1.4

I have a grain of download that retrieves a path and the name of a field in a table to use to download the particular file. I have the path string and name of the file in a string goes as:
/USR2/upload/SomeFileName.PDF
/USR2/spool/reports/anotherfile.PDF
I need to have the path into the name to get the files from various places. However when the following code is executed, it becomes automatically the / characters into underscores. How to make this work? I tried to replace the / with single and double- and all it does is to put single or double underscore traits.
    public void downloadReport(FacesContext ctx,
                               OutputStream out) throws IOException {
        DCBindingContainer bindings =
            (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
        DCIteratorBinding dcItteratorBindings =
            bindings.findIteratorBinding("BatchDetailVO3Iterator");
        ViewObject voTableData = dcItteratorBindings.getViewObject();
        Row rowSelected = voTableData.getCurrentRow();
        String filename = (String)rowSelected.getAttribute("ReportFileName");
        System.out.println(filename);
        File f = new File(filename);
        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;
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
        out.flush();
        AdfFacesContext adfFacesContext = AdfFacesContext.getCurrentInstance();
        adfFacesContext.addPartialTarget(getDetailReportsTable());

    }
Thank you
Troy

Try to understand the works of the sample. I use the fileDownloadListener, set up the content type and the file name. This you should do it too. Next step, it's the listener to download (the method you posted). I read data from a BLOB. The essential is that I create a stream of the BLOB one copy for the output stream of the listener.
Here, you will have to modify the code and generate the stream of the file.
The rest of the code can stand as is.

Timo

Tags: Java

Similar Questions

Maybe you are looking for

  • HD 5650 has new Catalyst Control Center 12.4 with 8.95 drivers!

    Closed by Sunshine Yes, I was really tired of it anyway.

  • Satellite M100-165: connection to the LAN operarte correctly

    I have a Satellite M100-165 for about 2 years with the original Setup (win XP etc) and I make all updates.The problem is that the connection to the local network is working properly from the beginning. I can connect only if I set the NIC property "li

  • Wanting to connect two monitors

    I have an HP 110-090 desktop PC.  I bought an adapter where can I plug 2 monitor cables into the one port at the rear (the blue one).  Both monitors display the screen but when I check the box so that it can extend the desktop and only show the icons

  • Rockbox status anyone?

    I bought the Fuze + because I waited for years to get a 50 GB or State more solid with radio and recording.  16 + 32 does really everything for me.  But like many here I am blocked by performance, poor scrolling, etc. by this device. I'm staying curr

  • Photosmart C309A does not install on Windows 8.1

    Hello. I managed to download the correct software and double the download so it extracted but after exrtraction nothing happens. Can anyone help?