In IE 6 File download frm Webdynpro generates RandomName whn download in EP

Hi Experts,
I have developed a webdynpro application where I download a file in the excel format.
I have written a code to generate the name of the file and have set it to the context attribute.
When I download the file from the Application
http://<server>:<port>/webdynpro/dispatcher/local/<project>/<application>
The name (test.xls) of the downloaded file is perfect
but when downloaded from the Jave webdynpro Portal Iview we get random names like "CAIF4T6T.xls" in the Dialog which stores the file on the local system.
Is there anything which needs to be done in Iview properties so that when downloaded into local machine we get the same name as we get during the download from the application directly.
It is working fine in Internet Explorer 7 But lower version not supported
Regards,
Krishna
Points will be awarded for helpful answers.

Hi
Have you find any solution for this problem
Thank You
Regards
Krishnamurthy

Similar Messages

  • File dwnloded frm Webdynpro App generates Random Name whn downloaded frm EP

    Hi Experts,
    I have developed a webdynpro application where I download a file in the excel format.
    I have written a code to generate the name of the file and have set it to the context attribute.
    When I download the file from the Application
    http://<server>:<port>/webdynpro/dispatcher/local/<project>/<application>
    The name of the downloaded file is perfect
    but when downloaded from the Jave webdynpro Portal Iview we get random names like "CARYHWT9" in the Dialog which stores the file on the local system.
    Is there anything which needs to be done in Iview properties so that when downloaded into local machine we get the same name as we get during the download from the application directly.
    Best Regards,
    Roby..

    Hi Siva,
    The thread u mentioned is titled as -  Error Message comming in German for invalid date format
    And theres nothing which I could notice that would solve the issue with the download.
    Please let me know if theres some specific thing u want me to do.
    Best Regards,
    Roby..

  • Java WebDynpro's and IE security settings for file download

    We have a EP 7.0 SP13 environment on which we have deployed a number of own developed java webdynpro's. In some of these webdynpro's we provide the file download functionality. The portal and webdynpro's are used by both internal personnel and external customers.
    On the other hand the default Internet security settings for Internet Explorer, disable "Automatic prompting for file downloads".
    When a user, with these default security settings active, tries to use our webdynpro's file download functionality, the screen seems to refreshes but no file download starts. When (s)he retries, the session runs for some minutes and gives following error message:
    "com.sap.tc.webdynpro.services.session.LockException: Thread SAPEngine_Application_Thread[impl:3]_20 failed to acquire exclusive lock on client session ClientSession".
    This behavior is explained in SAPNote 1234847. Webdynpro provides a single-thread module, meaning a user session is blocked for the during of the request. And because the previous file download isn't yet completed the new try can't start.
    Issue now, although the users IE settings allow file downloads and don't block pop up's, he can't download the file and even isn't made aware of the cause of the failure.
    How can we avoid this issue, without having to communicate the
    application requires specific browser settings?

    Welcome to the Apple Support Communities
    See > http://support.apple.com/kb/HT5290
    You can install the program using different ways:
    1. Right-click the application installer and choose Open.
    2. Go to System Preferences > Security and Privacy and select Anywhere in Allow applications downloaded from

  • File Download error in IE7 in Webdynpro Abap

    Hi Guru,
    I am Sandeep , My problem is realated to file download from IE. When I use IE6 my code works fine on the PRD server , But when I use IE7 , it gives an error  " Internet Exlpore cannot download the file ".
    But it works fine on Quality server either i am using IE6 or IE7.
    And i use the same code in other event , it works fine.
    Please help me.
    Regards,
    Sandeep.

    Hello Sandeep,
    Probably someone will help you if you paste here part of the source code.
    The issue could be due to different reasons, for example the one described here:
    [Note 1428974 - file name is garbled while downloading resource using IE6|https://service.sap.com/sap/support/notes/1428974]
    Cheers,
    Diego.

  • TAx Reporter Temse Files Download Automation

    Hi,
    I have a reuiqrement to download the Temse files generated in Tax Reporter. I have completed the code and it works fine if we run the program in foreground. But when I run the same program in background some Temse files downloaded have junk characters. If I download the same Temse file in foreground it works fine.
    There seems to be some issue with the FM when I run my progam in background.
    I have searched SDN and SAP Notes for any clues but did not get any.
    REPORT  ZPHOP_TEMSE  NO STANDARD PAGE HEADING
                      LINE-SIZE 1023
                      LINE-COUNT 65
                      MESSAGE-ID zz.
    DATA: BEGIN OF tape OCCURS 1,
             DATA(2000),
          END OF tape.
    DATA: force_ascii type c VALUE 'T'.
    DATA:  BEGIN OF int_msgs2 OCCURS 10,
             errnum(2) TYPE c,
             text1(8) TYPE c,
             text2(60) TYPE c,
           END OF int_msgs2.
    DATA: BEGIN OF g_int_temse OCCURS 0,
             dname    LIKE TST01-dname,
             dpart    LIKE TST01-dpart,
             dcretime LIKE TST01-DCRETIME,
             dcreater LIKE TST01-DCREATER,
          END OF g_int_temse.
    DATA: record_length  TYPE i VALUE 275,
           data_length    TYPE i,
           convert_to_ebcdic,
           filesize TYPE i,
           number_of_records TYPE i VALUE 1,
           filetype(3) VALUE 'BIN',
           conv TYPE REF TO cl_abap_conv_out_ce,
           dline TYPE REF TO data,
           dtab TYPE REF TO data,
           p_compid(4),
           p_pswd(8),
           g_str(2000),
           uc_filename TYPE string.
    DATA: l_nm_fixed_record.
    CONSTANTS: c_lpath TYPE pathintern VALUE 'ZOUT'.
    TABLES: TST01, ZPHOPFLS, ZTEMSE_LOG, V_5UXY_A.
    FIELD-SYMBOLS: <dtab> TYPE STANDARD TABLE,
                   <dline> TYPE ANY.
    INCLUDE: dbpnpcom.           " No logical database        Do not modify!
    INCLUDE: zphoptop,           " Top Include                Do not modify!
             zphopfil.           " File inlcude               Do not modify!
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE text-T01.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(30) text-001.
    SELECT-OPTIONS  s_temse FOR TST01-dname NO INTERVALS.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK B1.
    SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE text-T02.
    SELECT-OPTIONS  s_cai   FOR TST01-DCREATER NO INTERVALS.
    SELECT-OPTIONS  s_date  FOR sy-datum.
    SELECTION-SCREEN END OF BLOCK B2.
    SELECTION-SCREEN BEGIN OF BLOCK B3 WITH FRAME TITLE text-T03.
    PARAMETERS: p_ifid   LIKE t9aoa-if_id MODIF ID DIS ,
                p_fileid LIKE t9aoa-file_id MODIF ID DIS,
                p_unixf(60)  LOWER CASE MODIF ID DIS,
                p_uxdir  TYPE pathextern LOWER CASE MODIF ID DIS,
                p_dstfil(45) LOWER CASE MODIF ID DIS.
    SELECTION-SCREEN END OF BLOCK B3.
    PARAMETERS: p_skip AS CHECKBOX.
    DATA: ws_unixr LIKE p_unixf,
          ws_trans LIKE p_unixf.
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
        IF screen-group1 = 'DIS'.
          screen-output = '1'.
          screen-input  = '0'.
          MODIFY SCREEN.
        ENDIF.
      ENDLOOP.
    INITIALIZATION.
      p_ifid = 'PAYFLS'.
      p_compid = 'HR00'.
      p_fileid = '01'.
      p_unixf = 'AFS'.
      p_pswd = 'chevr123'.
      p_skip = 'X'.
    -End of Initialization--
      PERFORM get_physical_path.
      FORMAT COLOR COL_HEADING.
      WRITE: /01 text-t04,
              10 sy-pagno,
              41 text-t05,
             110 text-t06,
             123 sy-datum.
      WRITE: /01 text-t08,
              14 sy-repid,
             110 text-t07,
             125 sy-uzeit.
      FORMAT COLOR OFF.
      SKIP.
      WRITE: /(20) text-T21       CENTERED COLOR COL_HEADING,
              (15) text-T22       CENTERED COLOR COL_HEADING,
              (20) text-T23       CENTERED COLOR COL_HEADING,
              (15) text-T24       CENTERED COLOR COL_HEADING,
              (40) text-T25       CENTERED COLOR COL_HEADING.
    START-OF-SELECTION.
    *Do not allow background processing
    *Check if the Temse file and CAI both are entered
    IF NOT S_TEMSE IS INITIAL AND NOT S_CAI IS INITIAL.
       MESSAGE W999 WITH TEXT-E01.
    ELSEIF S_TEMSE IS INITIAL AND S_CAI IS INITIAL.
       MESSAGE W999 WITH TEXT-E02.
    ENDIF.
    Collect all temse filenames from TST01 into an internal table.
    IF NOT s_temse IS INITIAL.
       SELECT dname dpart dcretime dcreater FROM TST01 INTO TABLE g_int_temse
              WHERE dname in s_temse
              AND   dpart EQ '1'.
    ELSE.
       SELECT * FROM TST01
              WHERE DCREATER in s_cai
              AND   DPART EQ '1'.
         IF TST01-DCRETIME(8) GE s_date-low
             AND TST01-DCRETIME(8) LE s_date-high.
            MOVE-CORRESPONDING TST01 TO g_int_temse.
            APPEND g_int_temse.
         ENDIF.
       ENDSELECT.
    ENDIF.
    SORT g_int_temse BY DNAME DPART DCRETIME.
    LOOP AT g_int_temse.
    Check if the temse file is already processed in ZTEMSE_LOG table.
      SELECT SINGLE * FROM ZTEMSE_LOG
             WHERE DNAME = g_int_temse-dname.
      IF sy-subrc EQ 0.
    error. Temse already processed
         CONTINUE.
      ENDIF.
    Check if the temse file bieng processed is the eligible temse file
      SELECT SINGLE * FROM V_5UXY_A
             WHERE TSOBJ = g_int_temse-dname.
      IF sy-subrc EQ 0.
         SELECT SINGLE * FROM ZPHOPFLS
             WHERE TAXAU = V_5UXY_A-TAXAU
             AND   TXFRM = V_5UXY_A-TXFRM.
         IF sy-subrc EQ 0.
    Generate the filename for the target destination
            CONCATENATE ZPHOPFLS-FILENAME '.' sy-datum '.' sy-uzeit INTO p_dstfil.
         ELSE.
    error. Script not maintained in ZPHOPFLS table
            CONTINUE.
         ENDIF.
      ELSE.
    error. Temse file is not the latest processed file.
         CONTINUE.
      ENDIF.
      CALL FUNCTION 'RP_TS_OPEN'
        EXPORTING
          tsobj = g_int_temse-dname
         versn = g_int_temse-dpart
          empfg = 'RPUTSVUM'.
      COMMIT WORK.
      REFRESH tape.
      CLEAR   tape.
    Einlesen von der TemSe
      CALL FUNCTION 'RSTS_READ'
        EXPORTING
           PARTS1BY1 = 'X'
        TABLES
          datatab = tape.
      CALL FUNCTION 'RSTS_CLOSE'.
    Read the 1st line which is supposed to contains info important for
    the downloading procedure. The syntax of the line is :
      SAPxxxnnnyyyy  - the 1st 3 char 'SAP' indicates this line contains
    download related info. xxx can either be 'ASC' (for ASCII) or 'EBC'
    (for EBCDIC). nnn is the length of each record, e.g. 128 for SSA disk
    format, 275 for SSA tape format etc. yyyy can either be 'CRLF' (each
    record is delimited by CRLF) or blank (no CRLF).
    After processing the 1st line, the line is deleted from the internal
    table. Downloading begins on the 2nd line.
      READ TABLE tape INDEX 1.
      IF tape-data(3) EQ 'SAP'.
        IF tape-data+3(3) EQ 'EBC'.
          convert_to_ebcdic = 'x'.
        ELSEIF tape-data+3(3) EQ 'ASC'
              AND force_ascii EQ 'T'.
          filetype = 'ASC'.
        ENDIF.
        IF tape-data+6(3) NA '*'.
          record_length = tape-data+6(3).
        ELSE.
          record_length = tape-data+13(4).
        ENDIF.
        IF tape-data+9(4) EQ 'CRLF'.
          data_length = record_length + 2.
        ELSE.
          data_length = record_length.
        ENDIF.
        DELETE tape INDEX 1.
      ELSE.
        data_length = record_length.
      ENDIF.
    Transfer the Temse file data to Unix file.
          PERFORM transfer_file.
    Update the Log table with the temse details.
          ZTEMSE_LOG-dname = g_int_temse-dname.
          ZTEMSE_LOG-txcmp = V_5UXY_A-taxau.
          ZTEMSE_LOG-txfrm = V_5UXY_A-txfrm.
          ZTEMSE_LOG-filename = ws_unixr.
          ZTEMSE_LOG-DCREATER = g_int_temse-dcreater.
          INSERT ZTEMSE_LOG.
        WRITE: /(20) ZTEMSE_LOG-dname,
                (15) ZTEMSE_LOG-txcmp,
                (20) ZTEMSE_LOG-txfrm,
                (15) ZTEMSE_LOG-dcreater,
                (40) ZTEMSE_LOG-filename.
    ENDLOOP.
    *&      Form  get_physical_path
          Get Physical directory name for the given logical path name
    FORM get_physical_path .
      CALL FUNCTION 'ZFILE_GET_PATH_NAME'
        EXPORTING
          LOGICAL_PATH               = c_lpath
        IMPORTING
          FILE_NAME_PATH             = p_uxdir
        EXCEPTIONS
          PATH_NOT_FOUND             = 1
          MISSING_PARAMETER          = 2
          OPERATING_SYSTEM_NOT_FOUND = 3
          FILE_SYSTEM_NOT_FOUND      = 4
          OTHERS                     = 5.
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " get_physical_path
    *&      Form  TRANSFER_FILE
    FORM transfer_file.
      p_unixf = 'AFS'.
    Concatenate Date with Unix File name
      CONCATENATE p_unixf '.' p_compid '.' p_ifid  '.' sy-datum '.' sy-uzeit INTO ws_unixr.
    Concatenate Unix Directory with Unix File for Outbound
      CONCATENATE p_uxdir ws_unixr INTO p_unixf.
      PERFORM open_files USING p_unixf.
    LOOP AT tape.
         g_str = tape-data(record_length).
        TRANSFER g_str TO p_unixf LENGTH record_length.
        IF sy-subrc <> 0.
          MESSAGE ID '00' TYPE 'E' NUMBER '398' WITH 'sy-subrc:' sy-subrc
           ' Error Transferring to: ' p_unixf.
        ENDIF.
    ENDLOOP.
      PERFORM close_files USING p_unixf.
    ENDFORM.                    " TRANSFER_FILE
    Can anyone please check and tell me what I need to overcome this problem.

    Hi Bhaskar,
    I also have the same requirement to upload TemSe files in to application server.
    In FDTA tcode after we enter company code and click on enter.
    In the second screen checking and line item and go to edit and click on download button.
    Here we see a popup with default file name, and when we say ok the file will get downloaded into C:\.....
    Here our req is to upload the file automatically pick up via batch job and place it in the in to the application server and from there it should be placed in the Netwrok server (UNIX).
    Pls provide me with suitable code so that i can finish it off.I tried a lot but did not work.
    Thanks.

  • Filename on file download from jsp

     

    This may help:
              ----- Original Message -----
              From: "Erik Lindquist" <[email protected]>
              Newsgroups: weblogic.developer.interest.jsp
              Sent: Wednesday, June 28, 2000 6:20 PM
              Subject: How to dynamically display images in JSPs
              > This took a little while to figure out so I thought I'd share. After
              > doing some research I was led to the following approach on how to load
              > images from an Oracle database into a JSP:
              >
              > The "main" JSP:
              >
              > <HTML>
              > <head>
              > <title>Image Test</title>
              > </head>
              > <body>
              > <center>
              > hello
              > <P>
              > <img border=0 src="getImage.jsp?filename=2cents.GIF">
              > <P>
              > <img border=0 src="getImage.jsp?filename=dollar.gif">
              > <P>
              > world
              > </body>
              > </HTML>
              >
              >
              > And this is the image getter:
              >
              > <% try {
              > response.setContentType("image/gif");
              > String filename = (String) request.getParameter("filename");
              > java.sql.Connection conn =
              > java.sql.DriverManager.getConnection("jdbc:weblogic:pool:orapool"); //
              > connect to db
              > java.sql.Statement stmt = conn.createStatement();
              > String sql = "select image from testimage where filename = '" +
              > filename + "'";
              > java.sql.ResultSet rs = stmt.executeQuery(sql);
              > if (rs.next()) {
              > byte [] image = rs.getBytes(1);
              > java.io.OutputStream os = response.getOutputStream();
              > os.write(image);
              > os.flush();
              > os.close();
              > }
              > conn.close();
              > }
              > catch (Exception x) { System.out.println(x); }
              > %>
              >
              >
              > The thing to note is that there are no <%@ page import="..." %> or <%@
              > page contentType="..." %> tags - just the single scriptlet. It
              > seems that for every "<%@" the weblogic compiler sees it puts
              > out.print("\r\n"); statements in the generated java source.(???) I
              > don't know much about how browsers work but I think that once it sees
              > flat ascii come at it it treats everything that follows as text/plain
              > which is incorrect for the binary stream that's being sent. Another
              > work around was to set out = null; but that's kind of ugly and might
              > produce server errors. The real fix is to write a bean to handle images
              > which I'll work on next (does anybody have any hints on how to do
              > that?)
              Cameron Purdy
              [email protected]
              http://www.tangosol.com
              WebLogic Consulting Available
              "Ramesh" <[email protected]> wrote in message
              news:[email protected]...
              >
              > Hi,
              >
              > Even I could download the files with this technique, I couldn't open the
              file downloaded. It seems the file is getting currepted during tranfer.. Can
              u help me in this regard please?
              >
              > Thank u
              > Ramesh
              >
              > [email protected] (Anders B. Jensen) wrote:
              > >In an Web-application written in Java Server Pages it should be possible
              > >for the user to download data from the web-server. The data will never
              > >exist as a file on the web-server, only in the PrintWriter object, out.
              > >To force the Internet Explorer (IE) to show the download dialog window
              > >the Contenttype of the HTTP-header have been set to "html/transfer". The
              > >question is:
              > >
              > >Is it possible to set the filename appearing in the download dialog
              > >appearing on the client?
              > >
              > >
              > >Below is a listing of the source-code:
              > >
              > ><%@ page extends="com.beasys.portal.admin.PortalJspBase"%>
              > ><jsp:useBean id="download" scope="session" class="dk.lec.DownloadData" />
              > >
              > ><%
              > > String tmpstr;
              > > response.setContentType("html/transfer");
              > > out.clear();
              > > tmpstr=download.getStrbuffer().toString();
              > > out.println(tmpstr.trim());
              > >%>
              > >
              > >
              > >Anders B. Jensen
              > >Consultant, Research & Development
              > >LEC AS
              > >
              > >Remove the SPAMLESS to mail me.
              >
              

  • Can not open file download prompt in portal web app.

    Hi folks,
    I am migrating existing Struts app into portal web app and currently stuck on the following problem.
    In existing app, Struts action calls servlet that generates excel file, sets response headers:
    response.setContentType("application/vnd.ms-excel");
    response.setHeader("Content-Disposition","attachment;filename=thename.csv");
    that brings up "file download" prompt window.
    In portal app, the same code writes excel file content into browser window instead of the prompt.
    Has anyone had to deal with similar problem? Any help will be greatly appreciated.
    Alex.
    Version of portal used is 8.1 SP5
    Struts - 1.1

    Problem is resolved. For those who might be interested - specifying redirect=true on forward to servlet did the trick.

  • File download problem

    I am using the following code to present a file to the client to download when a report is generated. The code does what is suppose to, it presents a dialog box where the user can choose to open, save, or cancel the file download. However, when the file is downloaded it contains the client HTML at the bottom of the saved file. I checked the created file on the server and it does not contain the HTML at the bottom, so it is being added by the following jsp code when the file is presented to the user. Any help would be appreciated. BTW, this running on HP-UX 11i using oracle forms 10G.
       String RPT = request.getParameter("trig");
       String SDATE = request.getParameter("start_date");
       String EDATE = request.getParameter("end_date");
       String PRN = request.getParameter("prn");
    if(RPT != null)
         try {
              Runtime rt1;
              Process proc1;
              String[] doRefresh = {"/usr/bin/sh", "-c", "/usr/local/oracle/sql/st_tags/some_script '" + SDATE + "' '" + EDATE + "' '" + PRN + "'"};
              rt1 = Runtime.getRuntime();
              proc1 = rt1.exec(doRefresh);
              int exitVal = proc1.waitFor();
           String filename="/usr/local/oracle/sql/st_tags/temp/some_file.csv";
           response.setContentType("application/octet-stream");
           String disHeader="Attachment; Filename=some_file.csv";
           response.setHeader("Content-Disposition", disHeader);
           File fileToDownload=new File(filename);
           InputStream in=null;
           ServletOutputStream outs=response.getOutputStream();
           try {
              in=new BufferedInputStream
              (new FileInputStream(fileToDownload));
              int ch;
              while((ch=in.read()) != -1) {
              outs.print((char) ch);
           finally {
              if(in != null) in.close();
           outs.flush();
           outs.close();
           in.close();
         catch (Exception ignored) {}
       }

    Sorry, wasn't sure how important the HTML portion would be. Thanks for the response. Here is the HTML that is before and after the afore mentioned code.
    Before:
    <%@page import="java.lang.*, java.net.*, java.util.*, java.io.*"%>
    <%@page pageEncoding="UTF-8" contentType="text/html;charset=windows-1252"%>
    <%@page language="java" import="mil.uspfo.dpi.*" errorPage="default.jsp" %>
    <jsp:useBean id="AgnosticHostBean" class="mil.uspfo.dpi.AgnosticHostBean"
    scope="session">
    </jsp:useBean>
    <base href="http://<% out.print(AgnosticHostBean.getHostNameProperty() ); %>
    :7779/j2ee/">
    <html>
    <head>
    <title>Master Report</title>
    <link rel="stylesheet" type="text/css" href="styles/uspfo.css">
    </head>
    <body>
    <%@ include file="header.html" %>
    <h1>
    Master Report
    </h1>
    <form name="mstr_form" method="post">
    <p>Start Date:<input type="date" name="start_date">(example: YYYYMMDD)</p>
    <p>End Date  :<input type="date" name="end_date">(example: YYYYMMDD)</p>
    <p>Payroll # :<input type="text" name="prn"></p>
    <input type="SUBMIT" name="Button1" onClick="get_mstr_report()">
    <input type="hidden" name="trig" size="2">
    <br>
    <script type="text/javascript">
    function get_mstr_report() {
       document.mstr_form.trig.value="go";
    </script>AFTER:
    </form>
    <br>
    <%@ include file="footer.html" %>
    </body>
    </html>

  • JSF error message: Automatic prompting for file download

    This is a weird problem. I have a JSF application wherin I popup a new window on a submit button.
    The window opens a test.jsf page that redirects the output to a servlet1.
    Servlet then based on some parameters does a sendRedirectI() to different servlets out of context.
    Now the issue is that when the output is redirected to out of context servlet, that returns a file download.
    If in IE browser, if one does not do a setting of "Automatic prompting for file download", this window that I had opened on submit buttton vanishes in a jiffy. If the IE setting is done, it shows the file download correctly.
    I would want to show the user some kind of message by which he/she understands that this IE setting has to be done.
    I have tried several ways:
    1. Javascript: window.onbeforeunload on the test.jsf so that when the window unloads i can show some message. But since test.jsf forwards to servlet1, the html page generated does not show my script.
    2. I also tried checking if some windows registry can help me understand the setting.
    3. I tried writing in response object the javascript and then redirecting it to servlet out of context. But I guess sendRedirect() does a new request, so this did not help.
    Can anyone help? I am not sure if I am able to explain my problem correctly.
    Yani

    Here is the result.I used your code and it worked fine with IE setting Enabled. But when I tried to access the download servlet after opening a new window, it doesnt download the file.

  • Unwanted File Download box in JSF - Problem while Saving State.

    Hi,
    I am having a situation wherin there are multiple command links dynamically generated in a dataTable.When I click on any one of the links a file download dialogue pops up to save/open a pdf doc.Irrespective of any operations on the download dialogue, if I click on anyother link (i.e this is the 2nd click on tat page)
    then the file download doesnt pop up and instead the page is refreshed.
    On the 3rd click , the file download again pops up.
    The code in the action method of the command link goes like this
    public void showPDF() {
    byte[] pdf = // gets the data from another place.
    FacesContext faces = FacesContext.getCurrentInstance();
              HttpServletResponse response = (HttpServletResponse) faces.getExternalContext().getResponse();
              response.setContentType("application/pdf");
              response.setContentLength(pdf.length);
              response.setHeader("Content-disposition", "attachment");
              response.setHeader("Cache-Control", "cache, must-revalidate");
              response.setHeader("Pragma", "public");
              try {
                   ServletOutputStream output = response.getOutputStream();
                   output.write(pdf);
              } catch (IOException e) {
                        log.debug("IOException in viewPdf: " + e.toString());
         faces.responseComplete();
    }To fix the above problem ...I have included the following 2 lines of code just before invoking the responseComplete() method :
      StateManager stateManager = (StateManager)    
                                                                    faces.getApplication().getStateManager();
         stateManager.saveSerializedView(faces);This solves the above problem but causes another problem for which I need help :
    There is a value change listener in my jsp.When I change the value in a drop down list in the same page, the file download dialogue is poping up. which shuld only pop up when am clicking any one of the command links.
    I debugged thru the code and found out that after the value change listener action method is finished executing it jumps and executes the above showPDF() method.
    Seems its something to do with saving of the client state.
    It will be of great help anyone can advise on this.
    Thanks
    Archan

    Hi,
    I am having a situation wherin there are multiple command links dynamically generated in a dataTable.When I click on any one of the links a file download dialogue pops up to save/open a pdf doc.Irrespective of any operations on the download dialogue, if I click on anyother link (i.e this is the 2nd click on tat page)
    then the file download doesnt pop up and instead the page is refreshed.
    On the 3rd click , the file download again pops up.
    The code in the action method of the command link goes like this
    public void showPDF() {
    byte[] pdf = // gets the data from another place.
    FacesContext faces = FacesContext.getCurrentInstance();
              HttpServletResponse response = (HttpServletResponse) faces.getExternalContext().getResponse();
              response.setContentType("application/pdf");
              response.setContentLength(pdf.length);
              response.setHeader("Content-disposition", "attachment");
              response.setHeader("Cache-Control", "cache, must-revalidate");
              response.setHeader("Pragma", "public");
              try {
                   ServletOutputStream output = response.getOutputStream();
                   output.write(pdf);
              } catch (IOException e) {
                        log.debug("IOException in viewPdf: " + e.toString());
         faces.responseComplete();
    }To fix the above problem ...I have included the following 2 lines of code just before invoking the responseComplete() method :
      StateManager stateManager = (StateManager)    
                                                                    faces.getApplication().getStateManager();
         stateManager.saveSerializedView(faces);This solves the above problem but causes another problem for which I need help :
    There is a value change listener in my jsp.When I change the value in a drop down list in the same page, the file download dialogue is poping up. which shuld only pop up when am clicking any one of the command links.
    I debugged thru the code and found out that after the value change listener action method is finished executing it jumps and executes the above showPDF() method.
    Seems its something to do with saving of the client state.
    It will be of great help anyone can advise on this.
    Thanks
    Archan

  • XML file download to presentation server.

    Hi Experts,
    Here I have a question regarding file download to desktop.
    I have a report which will generate xml file. Once it is generated i would like to download to desktop.
    I tried with 'GUI_DOWNLOAD', but it is not working. It means the file is downlaoded to presentation server but when i opened it 'Page can't be displayed' message is comming.
    Could you pleas help me to solve this issue.
    Thanks in advance.
    Regards,
    Anil.G

    Hello,
    For processing XMLs always try to make use of the class CL_XML_DOCUMENT.
    You can download the XML stream to a local file using the method of EXPORT_TO_FILE class CL_XML_DOCUMENT.
    Further reading: [/people/uwe.schieferstein/blog/2010/10/17/visualizing-any-kind-of-xml-data-using-class-clxmldocument]
    BR,
    Suhas

  • File Download box appears despite content being text/html .....

    Hi
    I am supporting a set of web pages which display data to the user based on XML transformed by a set of style sheets. Currently when the user does something and fires the doPost method we get the "File Download" box appear with the message "Some files can harm your computer .................... ". The downloaded file is just the HTML used to display info to the user (with the appropriate embedded stuff from the stylesheet)
    I was under the impression that this dialogue box only appears when the content type is not understood by the browser. However, the content type is text/html ... so i am a bit stumped.
    can anyone suggest other ways in which this message can appear?
    cheers
    chris

    Just on the off chance anyone else ever has this problem and fins this post ( the problem was solved a long time and i forgot to update the post).
    The application in question attempts to log into a database via OC4J. The connection information in the data-sources.xml file was incorrect (specifically the database listener port). This was generating some bizarre exception which was propogated up and resulted in the above behaviour. I suspect that you could get the same effect thogh for many other reasons, so if you are having this problem i wouldnt get too hung up on this as a possible cause,.

  • How to check the status of file downloading?

    I have to download the selected file by using "file download" dialogue box.
    This "File Download" dialogue box provides options for "Open", "Save", "Cancel" or "More Info". It is similar to usual "File Downloading".
    And i am required to do further processing only if , file is "Open" or "Save".
    So how can i check the status of the option selected by the user?
    Following is the code snippet:
    res.setContentType("text/plain");
    res.addHeader("Content-Disposition", "attachment; filename=" +value);
    try
         uFile= new File(fPath);
         fSize=(int)uFile.length();
         fis = new FileInputStream(uFile);
         c=-1;
         while ((c = fis.read()) != -1)
              out.print((char)c);             
         fis.close();
         out.flush();
         out=null;
    catch(Exception e)
           out.println("Exception : " +e);
    } I tried to generate a flag and inside a while loop, and then checking the status of that flag outside of loop.
    But it doesn't work.
    It reflects the value of flag even if user selects "Cancel" Option.
    So, if there is any another way of checking the option selected by user from "Open","Save" or" Cancel", then please reply me.
    Thanks in advance.

    Is there any solution for this or any web link for this...?
    Thanks in advance,
    Waiting for reply

  • Typical Problem !! File Download UI related

    Dear All,
    I'm stuck in a typical problem. I upload files thru the File Upload UI and generate uique IDs against every upload document.
    For displaying the documents, the user goes thru a web page that has URL to a WDA application.
    This WDA application has the unique Number as application paramater.
    The problem : If the default view of the WDA has a button and on click the uploaded file opens properly. But if I write the same code in WDINIT , the code gets executed but doesn't open the uploaded file. Reason??? I fail to understand !!!
    Any help would be highly appreciated.
    Regds,
    Srini

    Are you using the attach file to response API?  Basically in the WDDOINIT, the page is being built for the first time. Therefore the framework on the client side isn't rendered yet to be able to download a file.  If you want a file download to trigger "automatically" upon a page load; consider using a timedTrigger UI element set to 1 second and then download the content upon the event of the timedTrigger.
    Is this WDA only being used to download the files via a Link?  If so consider if you really need WDA for this.  That's a heavy weight framework if you are only wanting to push the download of a file. A stateless BSP or even a ICF handler class might be much better options.

  • ZIP File has damaged contents - Multiple file download

    Hi,
    I am using ZIP API in Web Dynpro JAVA for multiple file download scenario.
    Issue:--->
    Some files are not opening correctly after unzipping the ZIP file.
    Example-1: some PDF files gives out message that " "
    Example-2: Also, a JPG file shows only upper half of the image.
    So in all, the content of generated ZIP file are damaged.
    Any idea why this is happening?
    Thanks & regards,
    Amey

    And this is the code I'm using:-
    Unzipped PDF files give this error --> There was an error opening this document. The file is damaged and could not be repaired
    for(int i = 0; i < l_int_NodeSize; i++){
         g_SearchOutputEle = g_SearchOutputNode.getCtx_vn_SearchOutputElementAt(i);
         java.net.URL url = new URL(g_SearchOutputEle.getFileUrl());
         java.net.URLConnection urlConnection = url.openConnection();
         java.io.InputStream inputStream = url.openStream();
         int arraySize = urlConnection.getContentLength();
         byte[] byteArray = new byte[arraySize];
         DataInputStream dis = new DataInputStream(inputStream);
         dis.read(byteArray);
         ZipEntry zipEntry = new ZipEntry("Name-"+i);
         zipEntry.setSize(byteArray.length);
         zos.putNextEntry(zipEntry);
         zos.write(byteArray);
         zos.closeEntry();
    zos.close();
    byte[] byteOutArray = baos.toByteArray();
    IWDResource resource = WDResourceFactory.createResource(byteOutArray, "Downloads.zip",WDWebResourceType.UNKNOWN);
    String urlString = resource.getUrl(WDFileDownloadBehaviour.ALLOW_SAVE.ordinal());
    IWDWindow win_MultiFileWindow = wdComponentAPI.getWindowManager().createNonModalExternalWindow(urlString);
    win_MultiFileWindow.setWindowSize(0,0);
    win_MultiFileWindow.show();
    Edited by: Amey Mogare on Mar 30, 2010 7:49 AM

Maybe you are looking for

  • Sharing itunes account b/w 2 different computers?

    I'm currently synced to my GF's computer, so we can share apps, but I want to be able to sync it to my computer without losing all my apps. I don't have any music on my iphone (that's what pandora is for! =P) so I don't care if I can't share music. S

  • Is there a way to "fully" disable, or delete, the passcode lock feature on an iPad?

    i am incharge of 50 iPads for ur schol district and have been creating profiles and enabling restrictions on the iPads. today i came across the 'passcode lock' feature, that i am sure all are fimiliar with. if i set that with a code, any student can

  • How to generate barcode from text field in adobe form???

    hello everyone, I'm new in this forum and I hope that there are people who can answer my question. I use Adobe Acrobat Pro 9. I have converted a Word template to a PDF template and everything works fine. I would like to generate a barcode of the cont

  • 2.2 hyperlinks not working in ibooks for desktop

    Hi there, So, I'm using 2.2's new feature in which you can create a text hyperlink to another part of the book from a drop-down menu in the inspector. It works perfectly in Author itself, and also when previewed on my iPad - so I know I'm doing it co

  • Purchase price inclusive of ED Value how to pass entries without splitting

    Hi My client is a Trader and there are some purchases where the Excise Duty is inclusive in the purchase price. Example Assessable value :                                  Rs.100.00 ED 16%                                                 Rs   16.00 Ec