How to open files in their native fromats in a browser

Hi,
i have jsp file which contains pure java script functionality, from this page i want to open local files. the same i can open with following code as html page but it is not opening when i place in the tomcat server,
code
function loadPage(id)
          if(id == 'launch')
               document.getElementById("docframe").src = "C:\\Documents and Settings\\3041\\documents\\01\\pdf\\DOM.pdf";
          if(id == 'prev')
               document.getElementById("docframe").src = "C:\\Documents and Settings\\3041\\documents\\01\\doc\\HR-007_Leave.doc";     
          if(id == 'next')
          document.getElementById("docframe").src = "C:\\Documents and Settings\\3041\\documents\\01\\excel\\sample.xls";                    
<table cellspacing="10" cellpadding="0" border="0" width="100%" height="100%">
     <tr valign="top" height="5%">
          <td align="left">
          <input type="button" id="prev" name="prev" onClick="javascript:loadPage('prev');" value="Previous">
</td>
          <td align="right">
          <input type="button" id="next" name="next" onClick="javascript:loadPage('next');" value="Next">
          </td>
     </tr>
     <tr valign="top" height="95%">
     <td colspan="2">
          <iframe id="docframe" src="javascript:pageCall('launch');" width="100%" height="100%"></iframe>
          </td>
     </tr>
     </table>
please help me in getting out of this problem

What is it you are trying to do???
The browser open files with their defaults programs, because they make use of the header values such as content-type. it seems that you are using DOM to archieve that, how do you expect that to work??
Something is not right.
MeTitus

Similar Messages

  • How to open file in their native application

    How to open file in their native application form web browser?
    if associated .txt file should open in editplus then from web browser if I try to open .txt file it should open in editplus rather then open in notepad(default), If on other computer if I associate .txt file should open in word, it should open in word. I am using Tomcat Web Server.

    that's nothing you could influence from a servlet or jsp.
    all you could do is specifying the content type of your response.
    Next you might hope that the client requesting your content uses a browser that relates the given content type to a special application (e.g. "text/plain" -> editplus or notepad or kedit or word or ...)

  • Raw files from the new Nikon D810 will not open with either Photoshop CS5.1 or Lightroom 4.  When will a real Adobe solution be available to work with Raw (NEF) files in their native format, using CS5.1 and LR4?

    Raw files from the new Nikon D810 will not open with either Photoshop CS5.1 or Lightroom 4.  When will a real Adobe solution be available to work with Raw (NEF) files in their native format, using CS5.1 and LR4?

    Clarification: this is a user forum; you are not addressing Adobe here.
    The answer to your question as phrased is: never.
    CS5 is history and it is not longer supported.  There will not be any updates or bug fixes for CS5.
    You need to convert the raw NEF files from your D810 to raw DNGs using the free, standalone Adobe DNG Converter 8.6 RC (beta), the first version ever to support that camera.. 

  • Switching to MAC from Windows: How to open files in Office 2007  VMFusion?

    Dear all,
    Intro:
    I switched to MAC and now cannot find the solution to a simple problem.
    First: I need an Office 2007 PowerPoint FULLY compatible solution.
    What did not work: IWork, NeoOffice, Office 2008 (this is not fully compatible with Office 2007 Files)
    I also had problems with: Parallels (not stable, too many hangups), codeweaver crossover (office files do not even open sometimes, good idea but not suitable for serious office jobs)
    Now I have VMWare Fusion with WinXP and Office 2007 as this seems to be the only truly stable and best solution to run Office 2007 on Mac
    Question:
    How to open files in Office 2007 on MAC VMWare Fusion easily?
    It would be nice to spotlight the file and click and it opens in powerpoint or excel or word 2007 in Virtual Machine.
    The only known solution to me is to use the Windows explorer to navigate to the file and then open it from Fusion WinXP. This is very cumbersome and honestly makes me think of getting back to a windows machine as I work with office frequently.
    Thank you for your help.

    Thank you for the quick reply.
    Yes, I have Office 2007 installed. The problem is that to open files in Fusion virtual machine I have to use the windows explorer and navigate to the file to open it. Now that I have the mac I want to use the good feature of spotlight. So when I search and find the file I want to open I cannot click on it on the mac (or in finder) but I have to switch back to the virtual machine, locate the file again and open it from windows.
    You might think - ok, why not skip the first step of using spotlight, and look up the file in windows explorer before anything else?
    Correct, but I know from parallels that there is a file association possible to directly access the file in office 2007.
    This does not seem possible in Fusion - So the question is whether there is a possibility on the mac to associate the file and to click on it in finder/spotlight and the office 2007 application in fusion opens the file. So far I could not find anything.
    Thanks

  • How to open file system file from Apex?

    Hi,
    Can someone help me to find how to open a pdf file e.g. test.pdf from apex when someone click on a button ABC?
    The file is located in /C/
    Thanks in advance
    Dip

    You can use the Onclick event and window.location to show the file when the user clicks a button.
    <input type=button onClick="window.location= 'file:///C:/Documents%20and%20Settings/rchamarthi/Desktop/test.pdf' + document.form1.cmuds.value;" value="Open File">The actual location of the file is "C:/Documents and Settings/rchamarthi/Desktop/test.pdf"
    Since the location is treated as a URL, remember that it should be URL encoded.
    Hence all spaces should be replaced by '%20' (32 being the ASCII for space and 20 in hex -> 32).

  • How to open files in MIDP (from the jar file)?

    Hello,
    I can't seem to figure out how to open a file that is in my MIDP applications jar-File.
    From what I've found via Google, I assume that the way to do it should be by using
    Connector.openInputStream("file:{path_to_my_file}")
    but I only get the error
    java.lang.ClassNotFoundException: com.sun.midp.io.j2me.file.Protocol
    (Running the Emulator from Suns WTK 2.0 with DefaultColorPhone)
    I've also tried file:// with the same result.
    Any ideas?
    Many thanks in advance!
    Bjoern

    I think I've found something that looks promising now:
    Class.getResourceAsStream()

  • How To Open A Folder of native system

    Hello Frnds can any body guides me how to open a folder of my system.actually i am using adobe air 2.0 for making a simple application in which i send and recived files.I simply uses File Class for extarct the nativepath of file.now i have path where my downloaded file stored.so Please tell me how to open the file or File Containg folder similary sevral aother web application does.
    Thanks In Advance
        Vineet Osho

    For opening the file itself, AIR 2.0 gives you a method in the File class called File.openWithDefaultApplication():
    openWithDefaultApplication
    method
    public function openWithDefaultApplication():void
    Language Version:
    ActionScript 3.0
    Runtime Versions:
    AIR 2
    Opens the file in the application registered by the operating system to open this file type
    The method description goes onto to talk about restrictions on file types in different operating systems.
    As far as opening a directory and performing some action on its contents, you can use the method File.getDirectoryListing(). This returns an array of File objects. You can test each File object with the isDirectory property, if you are interested in finding and dealing with sub-directories.
    Bill

  • How to open files using the Windows associated program?

    I have a LV program that is generating a list of files that I may want to open using the associated Windows program. Some are standard Office files but others require proprietary analysis programs.  All have Windows associations such that I can double click on the file name in the Windows file manager and launch the appropriate program. I would like to mimic this behavior within my LV program but without coding a case for each file extension, some of which I may not anticipate now.

    There are some problems with that VI.  I have one user that I had to track a problem down with trying to open a PDF file.  Their registry key HKEY_CLASSES_ROOT\.pdf was read in with a value of "AcroExch.Document                 " (with a lot of spaces after it), which prevented this VI from finding the next key (AcroExch.Document\shell\open\command) which identifies the path to Adobe Acrobat.  Instead of getting the path to Adobe Acrobat, I got back "Adobe Acrobat 7.0 Document" as the path (see attached error).
    I checked the key with the Windows registry editor, and it did NOT show the extra spaces.  However, just opening the key and selecting OK (without making changes) was enough to clear the problem.
    Not sure if this problem is with the registry keys that Adobe Acrobat created when it was installed or upgraded (the user was on version 9.0, but there are older versions on that machine, too), or if the problem was with the LabVIEW registry key readers in Open a Document on Disk.vi.
    Message Edited by Joe Gerhardstein on 05-13-2009 03:13 PM
    Message Edited by Joe Gerhardstein on 05-13-2009 03:17 PM
    Joe Gerhardstein
    Averna Test Systems
    Certified LabVIEW Architect
    http://www.averna.com
    Attachments:
    Open a Document.jpg ‏82 KB

  • How can open File Dialoge Box in Oracle9i

    can any one tell me how can i open file dialoge box in oracle 9i i am using webutil but when i run this code.. there is an exception during runtime.. not compile time.. so plz tell me how can i open file dialoge box.. thx..
         declare
              file_name varchar2(100);
         begin
              file_name := client_get_file_name(FILE_FILTER=>'TEXT FILES (*.txt|*.txt|');
         end;

    Please do not post the same topic in multiple forums. The
    only thing I can suggest is when they click on the button to
    download, you take flash out of full screen while they download the
    video, you can use fileReference to control and monitor the
    download. Use a listener object to monitor when download is
    complete, then set flash back to full screen.
    How are you scripting the full screen?

  • How to open files with .IVR on a mac

    Does anyone know how to open a .IVR file on a macbook? or any apps for the mac book to open it ?

    You can try
    http://download.cnet.com/RealPlayer-SP/3000-2139_4-24751.html

  • How to open files in CS4 and CS5?

    The graphic designers in my office have both InDesign CS4 and InDesign CS5 installed. CS4 is set to be the default for all Adobe files. However, if they want to open an InDesign in CS5, if they right-click and select "Open With" they can't choose to open with CS5. Even if they click "browse" and manually choose CS5. Anyone know why that is? They can open InDesign CS5 and then browse to file and open it within the program, so it's not a compatibility issue. Obviously this is more a matter of convenience for them (since they work with thousands of files) than a major problem, I would just like to know if it's possible to open InDesign files this way.

    It's an OS thing and you can't change it.
    You can, however, purchase the Soxy plugin from Rorohiko.com that will intercept the open commands and launch the correct version of ID based on the version in which the file was saved. I believe it costs about $20.

  • How to open files from old claris works with Appleworks 6 in OS X 10

    Hi,
    I have some claris works files backed up on a zip disk from a G3 with OS 7.X.
    Now I try to open them on another G3 with Appleworks6 in OS X 10.
    In Appleworks, I choose "open file" but those files are grey out so I cannot choose them. Is there anyway I can open those files in OS X 10?

    Kuul, welcome to Apple Discussions.
    MacLinkPlus @ http://www.dataviz.com/products/maclinkplus/ will probably translate the files so you can open them.
     Cheers, Tom

  • HT204382 Can anyone tell me how to open files in the format 'radio.ram' ?

    Can anyone tell me how to play files in radio.ram' format, as an add-on to QuickTime or whatever?

    Wow, that's a name from the past, Real Player. 
    And it worked.
    It's a product that I'd completely forgotten about going back to my days struggling with Windows on IBM clones and shows that I haven't tried listening to streaming Internet radio in a long, long time!
    Thank you very much, Varjak, for your help.
    Michael Young

  • How to open files using cmd command?

    Hello... First:
    try {
    Process p = Runtime.getRuntime().exec("cmd.exe ?????");
    catch(Exception e){ }well... I'm trying to open files using a cmd command. It's working only oppening files on my own pc, but i need to know if i can open files using a localweb's pc, with the follow address, for example:
    "\\172.21.0.4\firstdir\seconddir\thirddir..."
    Thanks :D

    Gamboua wrote:
    normaly, i type \\172.21.0.4\dir\dir\dir... directly directly in my cmd.This only works because you are already running cmd.exe
    Try getting it to work with cmd.exe at the start of the line.

  • How to open up new tab or window in 5800 browser?

    hey, just wondering how you can open up a new tab or window while browsing without exiting the current one.
    Sometimes when i click a link, a new window opens, and a little '2' appears at the top of the browsing screen indicating that 2 pages are open, and i know you can flip through the pages by clicking the 'three lined button' and then 'switch win', but im asking how can you just open a new page without exiting a current one?
    Thanks
    If iv helped in anyway, hit the kudos button

    Do a malware check with some malware scanning programs.<br />
    You need to scan with all programs because each program detects different malware.<br />
    Make sure that you update each program to get the latest version of their databases before doing a scan.<br />
    <br />
    * http://www.malwarebytes.org/mbam.php - Malwarebytes' Anti-Malware
    * http://www.superantispyware.com/ - SuperAntispyware
    * http://www.microsoft.com/windows/products/winfamily/defender/default.mspx - Windows Defender: Home Page
    * http://www.safer-networking.org/en/index.html - Spybot Search & Destroy
    * http://www.lavasoft.com/products/ad_aware_free.php - Ad-Aware Free
    See also:
    * "Spyware on Windows": http://kb.mozillazine.org/Popups_not_blocked

Maybe you are looking for