How to open a file located at server using JSP

hi,
i would like to open a file located at server as it is. I mean to say, if it a MS Word file, i wanna open it in MS Word, if it an Excel file, i wanna open it in Excel. i know the location (path) of the file. Can someone help me please.
Thanx

The best way would simply be to HREF it.
ie<a href="excelfiles/spreadsheet.xls">Open spreadsheet</a>When a user then clicks on that lick in their browser they should be given the option to either download or (if they have the appropriate program, in this case MS Excel, installed) open it.
This works best if the client is using a version of Internet Explorer (if you're dealing with MS files), but any browser should potentially offer you the option of opening the file.
Beyond that there's no way to specifically open a program on a client machine (it'd be a bit of a security loophole if you could! - Imagine a JSP page being able to open FDISK...). All you can do is pass the file (via the HREF) and let the client decide what to do with it.

Similar Messages

  • How to open  .exe file located in server system by the client system

    hi,
    i am using tomcat 5.0 as server and jsp as front end.
    I placed some of the software in the server system.I want to open the exe of those software from the client system when the user clicks the button.
    I am able to open them in the server system itself but if i try to open it from other system(client system using ip address of server system), the exe file gets opened and displayed in the server system only but not in the client system.
    any idea???
    Please help.
    Thanks & Regards,
    sirisha

    i am not using applets and downloading the software to clients machine is not required, the user has to click the "open software buttton" and it should get displayed in his system.
    anyhow can u give me some idea on using applets--- iam not good in applet coding.
    thanks & regards
    sirisha

  • How to open sdf files in SQL server 2012?

    How to open sdf files in SQL server 2012?
     I couldn’t figure out how to open the sdf files in SQL server 2012
     Thank you
     Best
     Jamal

    I don't think it's hard if understood the question properly you can try this I do it most of the time and this might be the solution for you, sometimes minor simple click is a life saver:)
    1. 
    Open SQL Server Management Studio, or if it's running select File -> Connect Object Explorer... and click the
    connect drop down arrow
    2. 
    In the Connect to Server dialog you will see Database Enghine, Analaysis Servie on so on and you go head change Server type to
    SQL Server Compact Edition
    3. 
    From the Database file drop-down as shown below click the drop down arrow and select <
    Browse for more...>
    4. 
    And you will see C:\, D:\, G:\
    drive and so on and open, your SDF file where it is located
    I hope this has been informative for you and good luck
    Please remember to click “Mark as Answer” on the post that has answered your question as it is very relevant to other community members dealing with same problem in seeking the right answer

  • How to upload a file in BPEL Console Using JSP in JDeveloper, pleae........

    I am very new to this JDeveloper & BPEl Process , please could some one help in ersolving my problem that is , how to upload a file in BPEL Console Using JSP in JDeveloper.

    Hi,
    ADF Faces provides you with the file upload component
    http://download-uk.oracle.com/docs/html/B25947_01/web_complex006.htm#CEGCEDHF
    http://download-uk.oracle.com/docs/html/B25947_01/appendixa007.htm#CHDEDCFA
    This gives you a handle to the file content. However, uploading files through a service is different and I suggest to consult teh BPEL forum for this BPEL
    Frank

  • How to upload a file in BPEL Console Using JSP in JDeveloper, please help..

    Please I am new to Jdeveloper and to BPEL Process of OASuite,I want to know , how to upload a file in BPEL process using JSP in Jdeveloper IDE.
    The main aim is first we need to upload a file in JSP , it has to go to BPEL Process & it has to read the file & write the respective file in return to JSP through BPEL Process. Please I am in Urgent need of the Query , please help me ASAP.
    Send to me response Please.....................................

    Hi,
    I thin that you asked the same question before and I premember that I ointed you to the ADF BC developer guide and the SRDemo if your application uses JSF. For plain JSP - if you Google for: JSP and file upload then you find plenty of sources for JSP and Struts.
    The remaining part is how to stiff the file into a BPEL service on the middle tier. For this I recommended to ask your question on the BPEL forum
    BPEL
    Note that the BPEL integration would be easier if it was done on the middle tier and not onthe client
    Frank

  • How to send XML file to https server using POST

    Hi, I am having an requirement, that I have to connect to https server and I have to pass an input XML file as a response server will give me output XML file.
    The certificate validation part is over, I am using FileInputStream to read the XML file and attaching this to connection.getOutputStream(); but server is throwing me DTD does n't match.
    Can any body tell me how to send XML file, I have to use any DOM parser to send the XML file, suggest me and give me sample code.
    Thanks,

    Can anybody give me the solution

  • How to Open a file in Application Server

    Hi All,
    I am having a recquirement that I had to read the data from an Application Server file, I want to know whether any function modules are there to open a file that is in the Application server.
    Thankx In advance,
    Sri.

    Hi,
    If you are on windows, the solution is to create a shared directory anf give access rights to your sapservice <SID> user.
    It's not really logical to put files on app servers because one app server can stopped without stopping the system.
    So we decided to put all our shared directories on the Central Instance server.
    Regards,
    Olivier

  • How to upload a file to the server using ajax and struts

    With the following code iam able to upload a file ato the server.
    But my problem is It is working fine if iam doing in my system nd when iam trying to
    access theis application from someother system in our office which are connected through lan
    iam getting an error called 500 i,e internal server error.
    Why it is so???????
    Plz help me????????
    It is required in my project.
    I want the code to access from every system.
    My exact requirement is i have to upload a file to the server and retrive its path and show it in the same page from which we
    have uploaded a file.
    Here the file has to be uploaded to the upload folder which is present in the server.Iam using Tomcat server.
    Any help highly appreciated.
    Thanks in Advance
    This is my input jsp
    filename.jsp
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>Insert title here</title>
    <script type="text/javascript">
    alertflag = true;
    var xmlHttp;
    function startRequest(file1)
         if(alertflag)
         alert("file1");
         alert(file1);
    xmlHttp=createXmlHttpRequest();
    var video=document.getElementById("filepath").value;
    xmlHttp.open("POST","FilePathAction.do",true);
    xmlHttp.onreadystatechange=handleStateChange;
    xmlHttp.setRequestHeader('Content-Type', application/x-www-form-urlencoded');
    xmlHttp.send("filepath="+file1);
    function createXmlHttpRequest()
         //For IE
    if(window.ActiveXObject)
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
         //otherthan IE
    else if(window.XMLHttpRequest)
    xmlHttp=new XMLHttpRequest();
    return xmlHttp;
    //Next is the function that sets up the communication with the server.
    //This function also registers the callback handler, which is handleStateChange. Next is the code for the handler.
    function handleStateChange()
    var message=" ";
    if(xmlHttp.readyState==4)
         if(alertflag)
              alert(xmlHttp.status);
    if(xmlHttp.status==200)
    if(alertflag)
                                       alert("here");
                                       document.getElementById("div1").style.visibility = "visible";     
    var results=xmlHttp.responseText;
              document.getElementById('div1').innerHTML = results;
    else
    alert("Error loading page"+xmlHttp.status+":"+xmlHttp.statusText);
    </script></head><body><form >
    <input type="file" name="filepath" id="filepath" onchange="startRequest(this.value);"/>
    </form>
    <div id="div1" style="visibility:hidden;">
    </div></body></html>
    The corresponding action class is FIlePathAction
    package actions;
    import org.apache.struts.action.Action;
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionForward;
    import org.apache.struts.action.ActionMapping;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import java.io.*;
    public class FilePathAction extends Action{
         public ActionForward execute(ActionMapping mapping, ActionForm form,
                   HttpServletRequest request, HttpServletResponse response)
                   throws IOException, ServletException
              String contextPath1 = "";
              String uploadDirName="";
              String filepath="";
                        System.out.println(contextPath1 );
                        String inputfile = request.getParameter("filepath");
                        uploadDirName = getServlet().getServletContext().getRealPath("/upload");
                        File f=new File(inputfile);
    FileInputStream fis=null;
    FileOutputStream fo=null;
    File f1=new File(uploadDirName+"/"+f.getName());
    fis=new FileInputStream(f);
         fo=new FileOutputStream(f1);
                        try
         byte buf[] = new byte[1024*8]; /* declare a 8kB buffer */
         int len = -1;
         while((len = fis.read(buf)) != -1)
         fo.write(buf, 0, len);
                        catch(Exception e)
                                  e.printStackTrace();
                        filepath=f1.getAbsolutePath();
                        request.setAttribute("filepath", filepath);
                        return mapping.findForward("filepath");
    Action-mappings in struts-config.xml
    <action path="/FilePathAction"
                   type="actions.FilePathAction">
                   <forward name="filepath" path="/dummy.jsp"></forward>
              </action>
    and the dummy.jsp code is
    <%=request.getAttribute("filepath")%>

    MESSAGE FROM THE FORUMS ADMINISTRATORS and COMMUNITY
    This thread will be deleted within 24 business hours. You have posted an off-topic question in an area clearly designated for discussions
    about Distributed Real-time Java. Community members looking to help you with your question won't be able to find it in this category.
    Please use the "Search Forums" element on the left panel to locate a forum based on your topic. A more appropriate forum for this post
    could be one of:
    Enterprise Technologies http://forums.sun.com/category.jspa?categoryID=19
    David Holmes

  • How TO DEPLOY JAR FILES INTO XI Server using SDM

    Hi XI Gurus,
       im working on adapter development. we have created jar file in NWDS.
       now going ahead to deploy into XI server through SDM.
       can we deploy jar files directly into xiserver through SDM. or it needs to convert to any other formate like EAR, SDA. then how would i convert to SDA.
      i any have clear idea on this... pls throw the ways how to convert........
               JAR File to EAR format
               JAR file to SDA format
               EAR file to SDA format         
       can any one explain the procedure step by step how to convert jar file into deployment archive file in order to succesfully into XI server.
              thanks  i advance. points will be rewarded.
      Regards
      Rajesh

    Hi Rajesh,
    JAR file in itself in not deployable.
    So v need to envelop this jar file into an EAR file and then v deploy this EAR file on SDM.
    Creating Jar
    Inside NWDS --> Windows --> Open perspective --> J2EE Development --> right click on ur proj --> Build EJB Archive
    Converting .EAR file to .SDA
    Converting .EAR file to .SDA
    Regards,
    Prateek

  • How to open sharepoint files in edit mode using associated link?

    Hi All,
    We are trying to use the URL links available through SSM to open documents we hold on SharePoint. These will be the action plans for the risks we are entering as KPIs. The aim is to established a one-to-one link between the risk KPI and the risk action plan as this is a fundamental reason behind using SSM for Risk.
    However, when we enter the SharePoint URL into the SSM admin screen, clicking the link from SSM UI opens up the file as an internet explorer page which can not be edited and saved back to SharePoint. We did find a way to get through My Network Places to over write the file, but this only works if you have previously opened and edited and saved the file from SharePoint and requires lots of navigation by the user and is therefore not an appropriate solution.
    Is there any way we this can be achieve? Appreciate your replies. Thanks in advance.
    Regards,
    David

    Hi Bob,
    Thanks for your reply. What I meant was when we put the UNC into SSM as a link in the URL box, SSM does not use the address it is given, instead it adds a http:// back in front and once again fails when opening the file in sharepoint.
    For example:
    SharePoint folder view used in test:
    http://wccportal/resources/performance/risk/Risk%20Action%20Plans/Forms/AllItems.aspx?RootFolder=%2fresources%2fperformance%2frisk%2fRisk%20Action%20Plans%2fDOR&FolderCTID=&View=%7b84123F22%2d74F2%2d41B9%2d918C%2dFF23DAE35EB3%7d
    Excel UNC link to folder
    wccportal\resources\performance\risk\riskactionplans\DOR
    SSM UNC Link - SSM changes the address to include http:// and also removes other \ breaks and adds in numbers and symbols.
    Is there a way to stop SSM converting the local address back into a web address?
    Thanks,
    David

  • How to Upload a File in Bpel Process using JSP

    I am trying to upload file in bpel process using front end as a Jsp.
    i create the jsp page and i am able to pass the value from jsp to bpel process.
    In bpel process i don't know how to pass or assign the specified file name into file adapter for reading the files.
    Please help me...
    Saravanan

    You don't assign the url of the file to it.
    To either get the data from the file into the bpel process you could use the url-parameter together with the ora:readFile function....or you could let your web-application upload the file to some location on the server...and on this location you could use the file-adapter together with the polling, to start your bpel process.

  • How Can Hide The File Name in URL Using Jsp

    I Want source code for Hiding The File name in url address using jsp.
    for example www.website/login.jsp is view but i want www.website/ only.

    Hi Praveen - how does that DEF would be determined?
    Have a look at the below blog for executing os commands
    SAP XI File Adapter OS Command Line Feature - Process Integration - SCN Wiki
    XI/PI: Command line sample functions
    Is there any problem in using the dynamic file name configuration??
    Message was edited by: Hareesh Gampa

  • How to open PDF file located on the SD card?

    The firefox browser has a cabability of opening the online PDF files. However, I cannot find a way to open the pdf files I have copied to the device's SD card via the USB connection.

    Hi,
    Thank you for this question, we don't yet have a way to read PDF files off of the sdcard on Firefox OS. Sorry for the inconvenience and thanks for your patience. There is a new app for exploring the sdcard (for sharing), so hopefully we'll have an app for reading PDF files coming soon.
    Best regards,
    Michelle

  • How to upload/download file to/from server using FiledownloadUI ?

    Hi experts,
    I don't have much experience of WDABAP. I have to upload a file  to server and then download it again. I have implemented  this functionality but I am unable to view contents of .xls/.doc/.docx/.msg file only  txt file contents are properly visible. I have used  following command to upload the file:-
    OPEN DATASET fname FOR OUTPUT IN BINARY MODE.
    I had  also tried this but it is throwing  exception that it can be used only for character type data.
    OPEN DATASET fname FOR OUTPUT IN TEXT MODE  ENCODING UTF-8    WITH SMART LINEFEED.  
    Thanks in advance.
    Problem Solved!
    Regards,
    Vishesh
    Edited by: Vishesh@1986 on Sep 26, 2011 7:37 AM

    I have resolved the issue myself!!!

  • How to Download a file from web server using servlets

    how do we download a file from Java Web Server connecting to oracle database
    it should start as soon a i click a button in my html browser
    please reply as it is needed to complete my project to submited to the collage

    With SQLJ you can do it.
    When you look at:
    http://otn.oracle.com/sample_code/tech/java/sqlj_jdbc/files/basic/basic.htm
    or
    http://otn.oracle.com/sample_code/tech/java/sqlj_jdbc/files/advanced/advanced.htm
    There are samples for reading LONGRAW / BLOB from Database. If you want use it in servlet you have to pass the result to the responce object, set the correct mime-type and set the response.setContentLength( xx). This is for some PlugIns nessessary (pdf).
    regards Dietmar

Maybe you are looking for

  • My Iphone doesn't want to open because its disabled, what can I do to open it?

    My Iphone doesn't want to work because its disabled by making the passowrd wrong to many times. It tells me to connect it to Itunes. I did I connected it to Itunes but it tells me that please respond on your Iphone. I can't open my Iphone so I can't

  • Best Practice: Combine prepared statements with ;

    Hi, I would like to know what the best prctice is for combining prepared statements to give the query below INSERT INTO my_table (value) VALUES (?); SELECT LAST_INSERT_ID()The reason for this is that i have written a simple DB wrapper to handle my da

  • Is there anyway to create a basic Image Viewer in CS5?

    Hello, Im looking for a really basic Image Viewer - exactly like the one you could create using DW CS3 but od corse it was discontinued. Is there any other way I can create something similar using CS5? or if not can anyone recomend a bsic one on - li

  • Quality of embeded MOV video

    Hi There, I have a some video as a mov format. It is saved in perfect quality, see picture 1 pls. When i eported it to flash into my swf project = the quality of video-pictures is VERY bad see picture 2.: HOW can i get the quality such as in the orig

  • Can't find Laserwriter 4/600 on network from Intel Mac mini

    Problem: Cannot find/print to networked LaserWriter using Airport network. Kit: Mac mini 1.66 GHz Intel Core Duo, 512 MB running Mac OS 10.4.5; Silver Apple Airport Base Station unExtreme; Netgear 814 combined switch/router/DSL modem; Asanté LocalTal