Problem opening html file in separate browser window

I have an forms app where a user can download a file from the database and then open that file on the client. After the file is downloaded, I use webutil_host.nonblocking ('cmd /s start' ||filename) and it works fine for .doc, .xls etc. as these open a separate program. Problem occurs when user downloads an html file, the command opens the file in the same browser window as forms is running, thus ending the forms session.
I've tried web.show_document('file:\\'||filename) but that fails as I assume it is looking for the file on the application server instead of on the client.
Any ideas on how to workaround this issue?

Well I searched around on google looking for a java servlet or jsp example and couldn't find one. I know they are out there becasue thats where I got mine about a year ago. I dont work at the same place anymore and couldnt take my code with me. Anyway, you would use this servlet for any document (xls, doc, html, txt, pdf) that is in the blob column in the db. The servlet would send a mime type first in the response and then the blob. The browser would display the blob in the associated helper application on the client (Excel, Word, IE, notpad, Adobe Acrobat Reader, etc..). The user can then save the document to their hard drive if they wish. This is faster becasue the clients hard drive isnt involved in the transfer from db to client. The user can then edit the document and reupload the document. Thats how we did it.
Maybe somebody else can post a link to a generic blob download servlet? Thanks..

Similar Messages

  • How Can i open Html file in a Browser from Jar file

    Hi
    i am having Html help files inside my Jar file ... if i use
    getclass().getRource("\lib\start.html");
    it is not opening ... so i have to ship seperate folders for html files along with jar files.... can anyone give the solution to have(open) html files inside the jar file and to open then in a default browser of any OS
    Regards
    Ganesan S

    the follwing method i have used to open html file ...
    so to access html file i am shipping resources folder with jar file ..
    private void openHtmlPages(String pageName) {
         String cmd[] = new String[2];
         String browser = null;
         File file = null;
         if(System.getProperty("os.name").indexOf("Linux")>-1) {
              file = new File("/usr/bin/mozilla");
              if(!file.exists() ) {
              }else     {
                   browser = "mozilla";
         }else {
              browser = "<path of iexplore>";
         cmd[0] = browser;
         File files = new File("");
         String metaData = "/resources/Help/Files/"+pageName+".html"; // folder inside jar file
         java.net.URL url = this.getClass().getResource(metaData);
         String fileName = url.getFile();
         fileName = fileName.replaceAll("file:/","");
         fileName = fileName.replaceAll("%2520"," ");
         fileName = fileName.replaceAll("%20"," ");
         fileName = fileName.replaceAll("jarfilename.jar!"," ").trim();
         cmd[1] = fileName;     
         try{
              Process p = Runtime.getRuntime().exec(cmd);
         }catch(java.io.IOException io){
                   //Ignore
    can anyone give me the solution..???
    Regards
    Ganesan S

  • Opening pdf file in a  browser window.

    I have a requirement to open a pdf file in a new browser window after onClick of a link. It is not the url of the pdf file. Actually the pdf file is generated dynamically by reading a blob column from the database and converting into a byte array and writing it to the outputstream. This is the code
    Currently on click of the link we are opening a jsp file which has the following code. We have put target=_blank in the link.
    String fileName = "DownLoadFile.pdf";
    response.setContentType("application/pdf");
    response.setHeader("Content-Disposition", "inline;filename=\""+ fileName + "\"");
    response.setContentLength(retrieveDocumentValue.getDocumentObj().length);
    try{
    ServletOutputStream out1 = response.getOutputStream();
    out1.write(retrieveDocumentValue.getDocumentObj());
    out.close();
    } catch (IOException e) {
    out.println("IO Exception");
    e.printStackTrace();
    }The problem is that,It is opening two window, one is an blank browser window and other pdf file in the Acrobat reader application? How can we open the file directly in the browser only without opening the Acrobat reader application externally?
    Edited by: thisisananth on Sep 17, 2008 11:13 PM

    We are facing this problem with IE6 browser only. In firefox, it opens fine in a browser window. What configuration should we do in IE6?
    Thanks,
    Ananth.

  • Why can't I drag an image or html file into a browser window with Firefox 17

    to get a quick view of various images or html files, I like simply dragging the files from my local drive into a Firefox browser window.
    since upgrading to FF 17, I can no longer do that. a NO symbol comes up when attempting this. and Dreamweaver will no longer preview with Firefox, even though it's my designated, preferred browser.
    anybody know if both of these are some setting or something?

    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance).
    *Do not click the Reset button on the Safe mode start window or otherwise make changes.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • Can't open pdf files in Safari browser windows (bank website window) after I installed Adobe Reader 11update on my Mac last night

    I previously had Adobe Reader 9, which worked perfectly.

    Here's EXACTLY what happens:  I am in a Safari browser website and try to open a pdf file (my bank statement).  When I click on the link I get this message in a black window: "Adobe Reader.  Before viewing a PDF file in this browser you must launch Adobe Reader and accept the End User License Agreement, then Quit and relaunch the browser."  So I launch Adobe Reader but there is no End User License Agreement to accept.  I have done this several times with no result.  I am using a MacBook Air with OS 10.9.4 and Safari 7.0.5.

  • Opening Excel file in User browser window

    Hi,
    My application generates Excel file from the rowset and stores on the server automatically when the user clicks a button, but I want the Excel file to be downloadable by the user either by opening the Excel file in the browser or by prompting the user to save the Excel file on the users PC.
    Any help will be greatly appreciated.
    Regards
    kush

    Hi Runa,
    Thanks for getting back to me. I have been through the already but that doesn't answer my question.
    Here is what i did, it might be rude but easy,
    public String generateExcel_action() {
    WorkbookSettings ws = new WorkbookSettings();
    workbook = jxl.Workbook.createWorkbook(new File("test.xls"));
    WritableSheet s1 = workbook.createSheet("Number Formats", 0);
    writeNumberFormatSheet(s1);
    workbook.setColourRGB(jxl.format.Colour.LIME, 255, 0, 0);
    workbook.write();
    workbook.close();
    }catch (Exception e){
    log("Exception while generating Excel file" + e);
    return null;
    * Writes out a sheet containing the various numerical formats
    * @param s
    public void writeNumberFormatSheet(WritableSheet s) throws WriteException
    try{
    WritableCellFormat wrappedText = new WritableCellFormat
    (jxl.write.WritableWorkbook.ARIAL_10_PT);
    wrappedText.setWrap(true);
    WritableFont wf = new WritableFont(jxl.write.WritableFont.ARIAL, 12);
    wf.setItalic(true);
    WritableCellFormat wcf = new WritableCellFormat(wf);
    CellView cv = new CellView();
    cv.setSize(25 * 256);
    cv.setFormat(wcf);
    s.setColumnView(0, cv);
    s.setColumnView(1, cv);
    s.setColumnView(2, cv);
    s.setColumnView(3, cv);
    WritableCellFormat horizontal = new WritableCellFormat();
    horizontal.setOrientation(jxl.format.Orientation.HORIZONTAL);
    // column headings
    Label l = new Label(0,0,"National Fault Number", horizontal);
    s.addCell(l);
    l = new Label(1,0,"Fault Title", horizontal);
    s.addCell(l);
    l = new Label(2,0,"Company Name", horizontal);
    s.addCell(l);
    l = new Label(3,0,"System", horizontal);
    s.addCell(l);
    int row =1;
    national_faultsRowSet.setCommand("SELECT * from national_faults");
    national_faultsRowSet.execute();
    while(national_faultsRowSet.next()){
    l = new Label(0,row,national_faultsRowSet.getString("national_fault_number"); , wrappedText);
    s.addCell(l);
    l = new Label(1,row,national_faultsRowSet.getString("fault_title"), wrappedText);
    s.addCell(l);
    l = new Label(2,row,national_faultsRowSet.getString("company_details.company_name"), wrappedText);
    s.addCell(l);
    l = new Label(3,row,national_faultsRowSet.getString("system.system");, wrappedText);
    s.addCell(l);
    row++;
    } catch (Exception e){
    log("Exception in writing EXcel " +e);
    test.xls is generated and stored in /install-dir/SunAppServer8/domains/creator/config, but I want the test.xls file either open in browser or prompt the user to save on his PC.
    I tried to get the data from dataTableModel's cache, for some reason it always returns null, any most obvious reason????
    Cheers
    kush

  • Opening XML file in the browser window after generating it.

    hi,
    my application generates an XML document by retrieving data from Oracle DB. To view that XML file i have to manually open it by going to relavant directory. I want to open it through JSP.
    Please help me. any sample code would be appreciated.
    thank u.
    [email protected]

    Instead of writing the xml to a file write it to the response. That will send it back to the browser
    Or create a new JSP that opens the file and then writes it to the response.
    ServletContext sc = getServletContext();
    BufferedReader in = new BufferedReader(new FileReader(sc.getRealPath("/") + "/xml.in"));
    String input = null;
    response.setContentType("text/xml");
    while ((input = d.readLine()) != null) { out.print(input); }
         

  • Firefox 6.0.1 will not open .aspx files in a browser window. Safari does it fine. I am greatly disappointed in your lack of help for this problem. Your forum people keep blaming the web site yet Safari works fine.

    I tried to read my electric bill and got a message to view in an application or download. I assigned Preview.app to view it and it wouldn't work. Safari opens the bill in Preview.app by default.

    Hello,
    '''Try Firefox Safe Mode''' to see if the problem goes away. [[Troubleshoot Firefox issues using Safe Mode|Firefox Safe Mode]] is a troubleshooting mode that turns off some settings and disables most add-ons (extensions and themes).
    ''(If you're using an added theme, switch to the Default theme.)''
    If Firefox is open, you can restart in Firefox Safe Mode from the Help menu by clicking on the '''Restart with Add-ons Disabled...''' menu item:<br>
    [[Image:FirefoxSafeMode|width=520]]<br><br>
    If Firefox is not running, you can start Firefox in Safe Mode as follows:
    * On Windows: Hold the '''Shift''' key when you open the Firefox desktop or Start menu shortcut.
    * On Mac: Hold the '''option''' key while starting Firefox.
    * On Linux: Quit Firefox, go to your Terminal and run ''firefox -safe-mode'' <br>(you may need to specify the Firefox installation path e.g. /usr/lib/firefox)
    ''Once you get the pop-up, just select "'Start in Safe Mode"''
    [[Image:Safe Mode Fx 15 - Win]]
    '''''If the issue is not present in Firefox Safe Mode''''', your problem is probably caused by an extension, and you need to figure out which one. Please follow the [[Troubleshoot extensions, themes and hardware acceleration issues to solve common Firefox problems]] article to find the cause.
    ''To exit Firefox Safe Mode, just close Firefox and wait a few seconds before opening Firefox for normal use again.''
    When you figure out what's causing your issues, please let us know. It might help others with the same problem.
    Thank you.

  • Why is Firefox opening a separate browser window for each link instead of a new tab in the current browser window?

    Suddenly firefox has started opening a new, separate browser window for every link and thing I open. It used to just open a new tab in the current browser. I must have closed down 15 browsers when trying to get back to a previous web page - the back button doesn't work when each click leads to a new window opening! I went into options and my settings have not changed, they still say "open new tab" for links. This just started happening out of the blue today. What's up?

    Start Firefox in [[Safe Mode]] to check if one of your add-ons is causing your problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    * Don't make any changes on the Safe mode start window.
    See [[Troubleshooting extensions and themes]] and [[Troubleshooting plugins]]
    If it does work in Safe-mode then disable all your extensions and then try to find which is causing it by enabling one at a time until the problem reappears.
    * Use "Disable all add-ons" on the [[Safe mode]] start window to disable all extensions.
    * Close and restart Firefox after each change via "File > Exit" (Mac: "Firefox > Quit"; Linux: "File > Quit")

  • Opening additional html file in same broswer window

    Hi here is what i wasnt to do i will write the whole process in sequence to make it clear.
    1. write to html file [accomplished]
    2. open html file from GUI in browser window [accomplished]
    3. rewrite html file from within GUI [accomplished]
    4. reopening the html file in the SAME browser window [the problem]
    Any one know if this is possible?
    here is the code im using to open the initial window...
    Process proc = Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler results.html");

    Ok heres what im doing...
    im using googles api..and in my GUI i have a "Next 10
    results" button, i could refresh the page X amount of
    seconds but this isnt really ideal.
    But looks like that is what im gonna have to to do
    ...unless anyone else has any better suggestions?
    (ps. i dont want to go down the JEditorPane path....
    =] )Well then if you dont want to refresh the page, then you can have 2 pages.. The second page would be just this
    <body>
    </body>And include this HTML in the main one using a iframe like this
    <iframe src="XXX.html" width="0" height="0"></iframe>When the user clicks the next button, you have to write 2 HTML this time.. The second one(XXX.html) would have the following code now
    <body>
    <script>
    parent.window.location.reload();
    </script>
    </body>Just confirm the 'parent' one.. I am not that sure whether its parent or parent_...
    Cheers
    -P

  • I can't open a pdf file in a browser window. I have to save it before I can open it. Why can't I open the file without first having to save it?

    Anytime that I click on a pdf file in a browser window, the file will not open automatically. I am forced to save it on my computer first and then access the file. When I click on it after it is saved locally, it opens as it should.

    If you are not able to get Adobe Acrobat Reader to open .pdf files in the browser. Even after you check in prefs to show pdf files in the browser.
    Make this modification for all versions of Adobe Acrobat Reader that show under this key.
    -Note: Deleting the key and all subkeys for any older versions also seems to fix this problem. So if you see this key present,
    HKEY_CURRENT_USER\Software\Adobe\Acrobat Reader\7.0\Originals
    delete the 7.0 and all subkeys.
    HKEY_CURRENT_USER\Software\Adobe\Acrobat Reader\9.0\Originals
    -Right click on Originals and choose NEW DWORD Value and name it bBrowserIntegration, hit enter,
    double click on the new value and make sure the value is 1

  • Need to open separate Browser window

    hi all, I want to display some data in a separate browser window instead of using popupManager. How do i do that. Also i need to pass parameter to that window, based on that parameter, i ll call the service and get the required data and display that in the datagrid.

    to open a seperate window, you'd have to use the navigateToURL() function
    to pass data to that window, you'd most likely need something like a GET method, if it's alot of data then you'd probably need to create a temporary file and pass a file reference via the GET method.
    or you could look into swf-swf communication

  • Unable to display this Web Part. To troubleshoot the problem, open this Web page in a Windows SharePoint Services-compatible HTML editor

    Dear All,
    I am frequently getting following error message on aspx pages on my SharePoint 2007 environment
    Unable to display this Web Part. To troubleshoot the problem, open this Web page in a Windows SharePoint Services-compatible HTML editor such as Microsoft Office SharePoint Designer.
    If the problem persists, contact your Web server administrator.
    Upon refreshing and restarting the browser several times, this error message temporarily gone and everything becomes fine. But after some time same error message starts appearing again. Also I have noticed that this error message also appears
    while working with SharePoint Designer 2007.Any clues how to resolve this issue ? 
    Any help in this regard will be greatly appreciated.
    Muhammad Tariq khan

    Hi All,
    As I regenerated the problem (Unable to display this Web Part... ) from the faulty
    user. I experience following error message in the ULS logs...
    Error while executing web part: System.Data.SqlClient.SqlException: Invalid object name 't5_sco'. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)     at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException
    exception, Boolean breakConnection)     at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)     at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler,
    SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)     at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()     at System.Data.SqlClient.SqlDataReader.get_MetaData()    
    at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)     at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior,
    Boolean returnStream, Boolean async)     at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)     at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior
    cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)     at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)     at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior
    behavior)     at Microsoft.SharePoint.Utilities.SqlSession.ExecuteReader(SqlCommand command, CommandBehavior behavior)     at Microsoft.SharePoint.SPSqlClient.ExecuteQuery(Boolean& bSucceed)    
    at Microsoft.SharePoint.Library.SPRequestInternalClass.GetListItemDataWithCallback(String bstrUrl, String bstrListName, String bstrViewName, String bstrViewXml, SAFEARRAYFLAGS fSafeArrayFlags, ISP2DSafeArrayWriter pSACallback, ISPDataCallback pPagingCallback,
    ISPDataCallback pSchemaCallback)     at Microsoft.SharePoint.Library.SPRequest.GetListItemDataWithCallback(String bstrUrl, String bstrListName, String bstrViewName, String bstrViewXml, SAFEARRAYFLAGS fSafeArrayFlags, ISP2DSafeArrayWriter
    pSACallback, ISPDataCallback pPagingCallback, ISPDataCallback pSchemaCallback)     at Microsoft.SharePoint.SPListItemCollection.EnsureListItemsData()     at Microsoft.SharePoint.SPListItemCollection.get_Count()    
    at Microsoft.SharePoint.WebControls.SPDataSourceView.ConvertToIEnumerableWrappers(SPBaseCollection items, Int32 firstRow, Int32 rowCount, String[] fieldList)     at Microsoft.SharePoint.WebControls.SPDataSourceView.ExecuteSelect(DataSourceSelectArguments
    selectArguments)     at System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback)     at Microsoft.SharePoint.WebControls.SingleDataSource.GetXPathNavigatorInternal()    
    at Microsoft.SharePoint.WebControls.SingleDataSource.GetXPathNavigator()     at Microsoft.SharePoint.WebControls.SingleDataSource.GetXPathNavigator(IDataSource datasource, Boolean originalData)     at Microsoft.SharePoint.WebPartPages.DataFormWebPart.GetXPathNavigator(String
    viewPath)     at Microsoft.SharePoint.WebPartPages.DataFormWebPart.PrepareAndPerformTransform()
    What does this error message mean ?
    Muhammad Tariq khan

  • Problem opening excel file in new window

    Hi,
    I have a JSF application that sends an Excel file back to the user.
    My backing bean has a method that uses POI to generate the excel file and then write it to the servlet response.
    This works fine if I call the method from a command button, but this displays the file in the current browser window, whereas I want to open the file in a new window.
    I added an onclick javascript call to a command button which does a window.open() to open a jsp in a new window. The jsp contains an empty view, as I'm using an on-load phase listener to make the call to my backing bean method which should send the excel file when the file opens.
    However, when the window opens, I get an IE error message saying 'Could not open xxx.faces', and then an excel error message saying 'Could not open xxx.xls. This may be because the file does not exist, or the file is already open etc etc'
    However, I found that if the popup window goes through a servlet (which just forwards to the jsp page) instead of going to the jsp directly, it works like a charm.
    Any ideas or suggestions on how to fix this would be very much appreciated. If I can't fix it I'll just stick with the servlet approach, although it just seems a bit messy.
    (I'm using IE6 SP2, tomcat 5.5 btw)
    Cheers,
    Stuart

    I'm doing a similar thing, but I use commandLink to lauch the window. CommandLink has the "target" attribute that I set to _blank.  As you would expect, that opens up the page in the new window.                                                                                                                                                                                                                                                                                                                                                                                                       

  • Problems opening .pdf files created in Windows in MAC

    My clients that are using Macs are having problems opening password protected PDFs that I created in Windows. Any suggestions?

    Are your clients using Adobe Reader on Mac, or the built-in Mac OS Preview?  Preview does NOT support the full PDF standard :(.
    From: Adobe Forums <[email protected]<mailto:[email protected]>>
    Reply-To: "[email protected]<mailto:[email protected]>" <[email protected]<mailto:[email protected]>>
    Date: Mon, 26 Sep 2011 15:04:18 -0700
    To: Leonard Rosenthol <[email protected]<mailto:[email protected]>>
    Subject: Problems opening .pdf files created in Windows in MAC
    Problems opening .pdf files created in Windows in MAC
    created by Hollcy<http://forums.adobe.com/people/Hollcy> in PDF Language and Specifications - View the full discussion<http://forums.adobe.com/message/3939175#3939175

Maybe you are looking for

  • How to make use of Portal service in the web dynpro application

    hi I have some portal service and how to use that in the web dynpro application. and also what is the main diff between Portal Component and web dynpro application. do we required portal to run web dynpro application. thanks mmukesh

  • TS4009 where is icloud on my computer?

    how do access and manage my icloud account on my MAC?

  • Webdb website name size

    Hi, I have installed webdb on hp-ux successfully and am able to build websites. The only problem I am facing is ORA-6502 PL/SQL error. I checked with metalink and it seems the website name exceeds the database name column size (30). Can anyone let me

  • ITunes 7 and USB Harddrive issue

    Everytime I install the new version of iTunes, it drops my USB Harddrive from the computer. The system thinks the drive is empty, yet all my folders are there, just no files. I do a system restore and no iTunes, but I can then see everything on the h

  • Ipod Touch 1st Big Issue

    My 1st Gen Ipod Touch, 16Gb, has been working rather well ever since I acquired it this february. However, ever since I updated it to 2.0 and up, it has been crashing on some applications, which was tolerable until two weeks ago, when it now turns on