In the jspdynpage how to implements file download!!!!

in the jspdynpage how to implements file download!!!!
in the portal's view i need to implements download file like *.xls,i don't know how to do. and if servlet can be used in the portal application!
Edited by: xuhuanjun on Apr 8, 2009 9:57 AM

Hi,
Check the below thread that will help you.
How to get a file download window using URL component in HTMLB/JSPDynpage
Raghu

Similar Messages

  • If it starts downloading on the ipad how can i start downloading on computer

    if I have rented a movie on my ipad and it starts downloading on the ipad how can i start downloading on computer as it is taking too long via wifi

    I know you need iTunes tosynchorinize your iPad, and i know ther is a connection kit (i searched internet before posting this question).
    The point is:
    We are on vacation. the iPad is my fathers. We have here only his iPad and my laptop. We wanted to put foto's we made with a digital camera foto's on the iPad, so i connected the iPad to my laptop, and was able to copy the foto's to the iPad. So they are on the iPad, but they cannot be viewed. Since I do not want to instll software on my laptop I do not need my self, and we see no point in buyin a connection kit for one time use, it would be great if you could just copy foto's to the iPad and then view them.
    I would appreciate it very much if someone could tell me how to do this. I am not used to working with tablets.so I am used to thinking "PC wise": youo copy files to a location on your computer and then you use a program to open those files. I know it works differently on an iPad, but it woul be great if this was one option that also would be available.

  • I had no idea that I needed to use a CD to download my Adobe Photoshop Elements 12 onto my MAC and have already registered the product; how can I now download it? I have tried loping on the web and no luck! Please help me!

    I had no idea that I needed to use a CD to download my Adobe Photoshop Elements 12 onto my MAC desktop and have already registered the product; how can I now download it? I have tried looking on the web and no luck. Please help me!

    You don't need a CD to download anything; just download & install the trial from http://www.adobe.com/cfusion/tdrc/index.cfm?product=photoshop_elements, then activate it with your serial number.

  • How to implement File Upload/DownLoad in OA page

    Hi All
    I have to implement the File download feature of OA Framework in my Custom OA page when i click the button.
    In developer's Guide i gone through this but i did'nt get what to set in
    File View Attribute,
    File Name Override,
    File MIME Type,
    and View Attribute
    Please Suggest
    Best regards

    The information is there in the dev guide
    File View Attribute - The view attribute that maps to the column that stores the file content.
    File Name Override - The file name to save to when you select the File Download link and choose the Save option in the File Download window to save the file. The default file name that appears in the File Name field of the Save As dialog window is derived from the value returned from the view
    attribute specified by the View Attribute property. The value of the File Name Override property overrides that default file name and is especially useful if the view attribute returns instructional text, such as "Click on this link to download the file". If the File Name Override property is not defined, then
    the file name to save to is the value returned from the view attribute.
    File MIME Type - The MIME type of the file. See the Runtime Control example below if you do not want to specify a static value for this property.
    Data Type - The data type of the File View Attribute. The BLOB datatype is now supported for File Download as of OA Framework 11.5.10D.

  • HT204370 i bought crouching tiger hidden dragon and i am not able to find the downloaded file in my iTunes. i would like to re-download it, as i see it in my purchase history. however, i don't want to have to re-purchase the movie. how do i re-download?

    how can i re-download a purchased movie that has been taken out of my itunes library without being charged again?

    You don't have a copy of it on your backup of your downloads and you've checked your computer's hard drive for it ? What you can re-download will show under the Purchased link under Quicklinks on the right-hand side of the iTunes store homepage on your computer's iTunes. If other films show there but not that one and it's still in your country's iTunes store then check to see if it's hidden : http://support.apple.com/kb/HT4919
    If it's not hidden and it's still in your country's store then you can try contacting iTunes Support and see if they wil grant you a re-download : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page, then Purchases, Billing & Redemption

  • Issue when implementing file download in OAF

    Hi,
    We are trying to download some data and create a excel file in the click of a button in the OAF screen. And the requirement is to navigate to the previous screen automatically after the file download. I have used pageContext.forwardImmediately()
    to navigate to the previous page after the download code, but the issue is during download control goes out of OAF screen and user saves the file on the desktop after that the control doesnot come back and move to the next screen.
    Any pointers has how to acheive this requirement would be of great help.
    Thanks in Advance,
    Raji

    Raji,
    How are you implementing the file download? If you are not using OAMessageDownloadBean, I would suggest to use it to make the process navigation easier.
    --Shiv                                                                                                                                                                                                                                                                                                                                                       

  • How to implement File to jdbc scenario

    Hi Guys,
               I am implementing a scenario where in data is passed from File to the database. I have completed the file adapter configuration part. now how do I implement the jdbc adpter part?
    Which database can I use for testing on the local machine?
    Can i download and use any database?
    If i want to use Access as a database what all settings do i need to do in access and Xi?
    Regards,
    Ashish

    Hi,
    This might help you
    /people/sap.user72/blog/2005/06/01/file-to-jdbc-adapter-using-sap-xi-30
    /people/siva.maranani/blog/2005/05/21/jdbc-stored-procedures
    /people/saravanakumar.kuppusamy2/blog/2005/01/19/rdbms-system-integration-using-xi-30-jdbc-senderreceiver-adapter
    /people/michal.krawczyk2/blog/2005/03/29/configuring-the-sender-rfc-adapter--step-by-step
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/3867a582-0401-0010-6cbf-9644e49f1a10
    Regards
    Agasthuri Doss

  • How to control File Download window

    I am using javax.servlet.ServletOutputStream for downloading the files. I am reading the InputStream from data base and writing into the ServletOutputStream object. I set the HttpServletResponse content type to "application/octet-stream".
    When I tried to download the file, the browser(IE) displaying the File Download window that consist of Name, Type and From details. How can I set the values for Name, Type and From fields. Also is it possible to customize the buttons like Open, Save, Cancel on this File Download window.
    Any help will be heighly approciated.
    Regards
    Venkat

    this is simple code for downloading , if you don't get desired results then specify ur problem in detail
    package p1;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    public class Download extends HttpServlet
    public void doGet(HttpServletRequest req,HttpServletResponse res)throws ServletException,IOException
    res.setContentType("text/html");
    ServletContext ctx=getServletContext();
    InputStream is=ctx.getResourceAsStream("/xyz.jar");
    int read=0;
    byte []bytes=new byte[1024];
    OutputStream os=res.getOutputStream();
    while((read=is.read(bytes))!=-1)
    os.write(bytes,0,read);
    os.flush();
    os.close();
    }

  • How to get file download dialog box in IE 6.0 for .CSV files?

    In our Java application, when we download .csv file (by clicking a tool bar button or menu item) in IE 5.5, it brings up the download dialog box and when we click the open button it opens the file in a seperate browser window but after migrating to IE 6.0 it doesn't bring the download dialog box and we are not able to open the excle sheet in a new browser window.
    We tried downloading .csv file in IE 6.0 by changing its extension(such as .cs1 and .xls) even then it did not work.We also tried associating CSV type of extension with "Microsoft Excel Comma Separated Values File" in the Windows folder options (Windows Explorer->tools->folder options->file types(tab)), which did not work.
    Please respond if you have come across this kind of issue and solution for the same.
    Thanks in Advance

    This has nothing to do with Java. It's Microsoft
    setting for known file type. IE is responding to the
    setting which will automatically download known file
    type (MIME type).
    To show the "Save As" file dialog, you have to do the
    following (for each file type)
    1. open Window Explorer
    2. click on Tool-->"Folder Option"
    3. click on the "File Type" tab
    4. select the extension and then click on the
    "Advance" button
    5. Check the "Confirm open after download" checkbox
    6. Click OK
    IE should now display the "Save As" file dialog for
    that extension. Remeber, you have to to this for all
    extension you want to see a "file dialog" pop up.Unfortunately this is not the only cause. Even with this box checked, downloading java source files from the pages of The Java Tutorial causes them to open in the most recent IE - I (and others also) don't get the save/open dialog box. Java source files downloaded from (some) other websites result in the save/open dialog box. I believe that one of the security changes that MS made in IE's handling of files is the cause. The setting of content-disposition by the server appears to be the key, according to MSDN information.

  • How to implement a download link

    i would like to implement a download link in jsp. Can anyone show me how to do this?
    thanks.
    cc

    simple html:
    <a href="linkToFileToDownload.exe"> Download my cool app!</a>

  • Implement file downloading... how to...

    Hi! I'd like to ask help about downloading files with servlets/jsp. My servlet writes to a textfile, 'text.txt'. I hava a link to my jsp specifying the location of 'text.txt'. I wanted it to be downloaded but instead it is opened by the IE browser. I tried changing the file extension to '.bir' but still it was opened by the browser. Is there a way I could download this textfile upon clicking the link on my jsp? Thanks in advance!
    Dredie :)

    Hi,
    Try out with extension .jar.
    cheers,
    Narayana

  • How to make file download in JSP ?

    Friends,
    i am using following code :
    // LISTING FILES IN DIR
            out.println("<br>");
            File dir = new File(dirName);
            String[] children = dir.list();
                 if (children == null)
            // Either dir does not exist or is not a directory
                 else
                    %>
                    <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="68%" id="AutoNumber1">
                    <tr>
                        <td width="50%" align="center"><font face="Verdana">File</font></td>
                        <td width="50%" align="center"><font face="Verdana">Action</font></td>
                          </tr>   
                        <%
                        for (int i=0; i<children.length; i++)
                        // Get filename of file or directory
                        String filename = children;
    //out.println(filename);
    %>
    <tr>
    <td width="50%">
    <p align="center"><font face="Verdana"><%=filename %></font></td>
    <td width="50%">
    <p align="center"><font face="Verdana"><a href="<%= children[i %">">View</a></font></td>
    </tr>
    <%
    out.println("<br>");
    %>
    SInce i am not able to download file from link.
    link shows path correct but why its not working ??
    HELP ME.
    *i don't want to show real path( physical location of file) on file donwload link.*
    Example :
    *it will not allow to show like following :*
    *C:\project\webUpload\build\web\fuploads\file2.jpg*
    *it may allow like :*
    *\webUpload\fuploads\file2.jpg*
    Thanks</a>

    My friend you are getting it all wrong here...
    Here we would be taking help of a dedicated servlet to locate and download a file(which would be the output the respective concent of depeding of the fineName or fileId you send in).
    Please find some time and try to consider the below case...
    Say i have a Servlet which takes a Request of detailed filePath and would give output as file itself....
    and you prompt you give a link to that servlet from you JSP to download that file...
    Checkout the below Code snippets to get some idea
    DownloadPrompting.JSP:
    ==================
    <a href="FileServlet?fileName=C:\fileuploaded\image1.jpg" title="C:\fileuploaded\image1.jpg">Click Here to download Image1 JPEG File</a>
    <c:forEach var="fileName" items="${sessionScope.fileNames}">
       <a href="FileServlet?fileName=<c:uri value="${fileName}"/>" title="<c:out value="${fileName}"/>">Click Here to download</a>
    </c:forEach>
    -------------------------------------------------------------------------FileServlet.java
    ===========
    package com;
    import javax.servlet.ServletConfig;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import java.io.BufferedOutputStream;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.IOException;
    import java.net.URLConnection
    public class FileServlet extends HttpServlet{
      private void processAction(HttpServletRequest request,HttpServletResponse response) throws Exception{
           // getting fileName which user is requesting for
           String fileName = request.getParameter("fileName").replace('\\','/');
           boolean exists = new File(fileName).exists();
           // Checking whether the file Exists or not      
           if(exists){
            FileInputStream input = null;
            BufferedOutputStream output = null; 
            int contentLength = 0;
            try{
                // Getting the Mime-Type
                String contentType = URLConnection.guessContentTypeFromName(fileName); 
                if(contentType == null)        
                   contentType = "application/octet-stream";
                input = new FileInputStream(fileName);
                contentLength = input.available();
                // Enables us to specify of what kind of content we are trying to download.
                response.setContentType(contentType);
                // Specifes How much amountof data we straming & trying to download
                response.setContentLength(contentLength);
                // Adding Content Disposition header so that it cud enable us to get OPEN/SAVE  after clicking on the link 
                response.setHeader("Content-Disposition","attachment;filename="+fileName+"\");
                // Initializing File Streaming Response via a Servlet
                output = new BufferedOutputStream(response.getOutputStream());
                // Placing each byte on to the stream after reading it from the file
                while ( contentLength-- > 0 ) {
                   output.write(input.read());
                 // Flushing the stream.         
                 output.flush();
              }catch(IOException e) {
                     System.err.println("Exception Occured:"+e.getMessage());
                 System.err.println("Exception Localized Message:"+e.getLocalizedMessage());
              } finally {
                   // Closing the INPUT stream 
                   if (input != null) {
                       try {
                          input.close();
                      } catch (IOException ie) {
                          System.err.println("Exception Occured:"+e.getMessage());
                             System.err.println("Exception Localized Message:"+e.getLocalizedMessage());                      
                   // Closing the OUTPUT stream 
                   if (output != null) {
                       try {
                          output.close();
                      } catch (IOException ie) {
                          System.err.println("Exception Occured:"+e.getMessage());
                             System.err.println("Exception Localized Message:"+e.getLocalizedMessage());                      
           }else{
             response.sendRedirect("/errorPage.html");
      public void doPost(HttpServletRequest request,HttpServletResponse response) throws Exception{       
            processAction(request,response); 
      public void doGet(HttpServletRequest request,HttpServletResponse response) throws Exception{
            processAction(request,response); 
    }And if you are thinking of hiding filepath & all...
    Here is a hint for you...
    Try to maintain a properties file which has a key value pairs of that something like.
    112345678=C:\\uploadfile\\image1.jpg
    122142637=C:\\uploadfile\\image2.jpg
    or create a Database table which which an autogenerated primany key with some Id and holds the complete filePath.
    and in this case you would access the file something like the one below from your jsp
    <a href="FileServlet?fileId=112345678" title="112345678">Click Here to download Image1 JPEG File</a>
    <c:forEach var="fileId" items="${sessionScope.fileNames}">
       <a href="FileServlet?fileId=<c:uri value="${fileId}"/>" title="<c:out value="${fileId}"/>">Click Here to download</a>
    </c:forEach>
    -------------------------------------------------------------------------and in the fileServlet you might have to change the below part to
    // getting fileName which user is requesting for
           String fileName = request.getParameter("fileName").replace('\\','/');to something like
    // getting fileName which user is requesting for
           String fileId = request.getParameter("fileId");
       /*Querying the database or reading the Properties file to findout the correspoding filePath associated with the fileId something like*/
        String fileName = ResourceDelegate.getInstance().getFile("fileId").replace('\\','/');
    NOTE:* The idea is similar to what my fellow poster is trying to explain you in all his posts.
    Hope that might help :)
    REGARDS,
    RaHuL

  • How to force file download message box appear????

    I download file from oracle
    how to set response header to make download message box appear??????
    I just see lots of :
    ���?������ Y�Dl?��>��hn��?g�x~����?7���}��h`a�F��?P?!P��*�X��?/?U ��A?|?/??$�T=��t ��?^!i��f��/?]?�c��7?�UZ�Gz?��SbU��p���Q�T������?��e JyN�/�X^��w��/Bo�k�O��������^��$��?�������yg���C(??[�[+?��R�����p��?te@?��o��?M:D�_s#h�����H��g/?�nE"�PQI���A!��bE������?C`A�������?V��2�^��<�NK?[��k�k$??yJ>?sg-hm�AW(���S��?l[��[���� ��?dL4��6!�N��*���N?Q2?���JoP��>|�sb�_�^�_����~�r��X
    on the screen
    I am a chinese, happy new year everyone!

    and the file.size() is semicode, meaning there isnt a function for it. So you might end up with something like this
         response.setContentType( "application/zip" );
         String fileName = Globals.getAttachmentLocation() + readFile;
         response.setHeader("Content-Disposition", "attachment;filename=" + fileName);
         BufferedInputStream bufferedInputStream = new BufferedInputStream( new FileInputStream( fileName ) );
         ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
         int start = 0;
         int length = 1024;
         byte[] buff = new byte[length];
         while ( bufferedInputStream.read( buff, start, length ) != -1 ) {
              byteArrayOutputStream.write( buff, start, length );
         bufferedInputStream.close();
         response.setContentLength( byteArrayOutputStream.size() );
         response.getOutputStream().write( byteArrayOutputStream.toByteArray() );
         response.getOutputStream().flush();

  • File path selected by the user!!! (File Download)

    Hi,
    Does exist a component, code line or any thing which emulate the Windows option <b>SAVE AS:</b> when the user does right click, but using a button to do this?
    If somebody knows? I will appreciate it.
    Thanks in advance!!!
    Tokio Franco Chang

    Noufal
    Thanks for your information!!! I found this post Re: Looking for example to export data from a DynPro table to Excel file which has code lines to export data from a Web Dynpro table to Excel file, it is saved perfectly in the local machine and save it in the server won't be problem.
    Your recomendation about the post it is to provide a popup window to change the name and extension of the file, how can I make it? ... Is there an UI Element in NWDS?
    Regards,
    Tokio

  • How to implement File lastmodified to compare IF FILE IS Modified ?

    rgds,

    Hi
    I dont understand your question properly, but I guess U wanna see if a file(on your local system) has been modified or not, while specifying a given time. What I mean is if you have a function say "ismodified(Date d)" means that "Is the file modified after d?". Is that what you mean?
    Then you have to write your own class that extends File say MyFile that has this particular function.
    class MyFile extends File
    public boolean isModified(Date d)
    Date now = new Date();
    long present = now.getTime();
    long lastmodified = this.lastModified();
    if(present==lastmodified)
    return false;
    else
    return true;
    I am not sure if this is what you are looking for.
    Cheers
    -Uday

Maybe you are looking for

  • How to extract the signal out from the waveform by my designated power level?

    Dear all,      How can  I extract the signal from the waveform accroding to the power level? I read the Trigger&Gate.vi, but this vi extract signal according to the duration time. I want to extract signal according to power level.      As shown in th

  • Germany vs Brazil Live Streaming Fifa World Cup Semi Final 2014 Online Watch Espn

    http://www.boston.com/community/forums/sports/mixed-bag/general/germany-vs-brazil-live-streaming-fifa-world-cup-semi-final-2014-online-watch-espn/100/7232782 http://www.boston.com/community/forums/sports/mixed-bag/general/germany-vs-brazil-live-strea

  • 40Gb i-pod Troubles

    I have had my 40Gb 4G i-pod for 11 months and have had nothing but trouble running it with my Toshiba satellite A 30-921 laptop. I am now in my third i-pod which i haven't used yet but i've been reading the forums and have decided to buy a Adaptec 14

  • I can't play XBOX , error code 805a201b

    Hotmail created, but still not working error 805a201b

  • Validity link

    Dear all I have created class ,chara, value and maintain validity of document at time of creation of DIR.But that validity is used for disply purpose but it can not control the document. ex: valid from --30 june 2009       valid to - 21 july 2009 IF