CSV File download error

Hi,
We have a struts wweb application deployed on weblogic 8.1.3. There is a csv file download functionality in one of the screen. On that screen, first user has to select certain filter parameters and depending on selections made, he gets a set of records on screen. After this, he has the option of downloading the filtered records(appearing on screen) or the entire data set in database in a csv file. Now if user selects the option of downloading entire datasets then it throws following error on screen. error 400 Bad Request.
log file shows connection reset by peer.
else if he choses filtered data it will be fine. moreover the error doesnt appear always. it behaves in random manner.
Could you please advice what can be the problem? Thanking you in advance
Regards,
Manu

user464106,
As I recommended over on the HTML DB forum, please review this thread. Try the recommendations there and report your findings.
Problem with importing HTML DB applications
Sergio

Similar Messages

  • Disconnected Application Cache .CSV file contains error Code 4

    Dear All,
    Recently we are facing an issue in our BI application . We have implemented Disconnected Application Cache via ibots in our application . We have used preprocessed sync and according to the process what it does is , it saves the data in .csv files into server by making folders of disconnected users.
    Currently , we fould and issue that particular report does not contain data in disconnected mode. Whne we backtraced the issue we found that , the underlying table for the report is empty and when we further investigate we found that , the .csv file kept in server against Uset folder contains an error code , which is :
    <error><error Code>4</error Code></error>TS
    For this reason no data is there in csv files and the disconnected report is also showing emmpty columns for that.
    Can anybody please help me solving this issue . I am not sure why this error happens and what this kind of error code signifies.
    As it is a production issue, it becomes very urgent to solve this . Can anybody please give me some idea how to resolve this one.
    Thanks and Regards,
    TG

    Are you sure that the input file (e.g. "Downloads/filetoberead.CSV") is in UTF-8 character set? You can also check it using some text editor having a view in hex mode. If each Cyrillic character in your input file occupies a single byte (instead of two), then the file is not in UTF-8. Most probably it is in Cyrillic for Windows (CP1251).
    If this is the case, you should modify the line
    BufferedReader br = new BufferedReader(new InputStreamReader(in,"UTF-8"));toBufferedReader br = new BufferedReader(new InputStreamReader(in,"windows-1251"));Dimitar

  • Separator problem in CSV file download

    Hi All,
    I am downloading the internal table data in CSV file format using the function modules SAP_CONVERT_TO_CSV_FORMAT  and GUI_DOWNLOAD.
    In the FM SAP_CONVERT_TO_CSV_FORMAT the default value for field separator is ;. But I want comma.
    I am passing comma as a field separator but I am getting ; in my CSV file.
    Please help.
    Thanks in Advance.
    - Neha.

    Hi
    It seems fm SAP_CONVERT_TO_CSV_FORMAT doesn't use the parameter I_FIELD_SEPERATOR, but a the constant C_FIELD_SEPARATOR with value ;
    So u should replace ; with comma after calling that fm or check a SAP note
    Max

  • 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.

  • Dyanmic csv file downloading with out writing a copy to server

    Hi,
    Here is my problem, any help most appriciated..
    I want to download dynamically created CSV file from the weblogic server, using jsp/servlet communication.
    I developed a servlet for this and i called that servlet from my jsp page, when user clicks on download button, my servlet works fine, but it writes a copy of CSV file into c:\bea\wlserver6.0 of the server, My intention is just it's has to dowload file to the client system, with out writing a copy in the server.
    Here is my code snnipits..
    public void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException {
    HttpSession session = req.getSession(true);
    try {
    resultMessageLastBalance = mtdRetrieveLastBalance(req);
    rsTrxnDetailLastBalance = resultMessageLastBalance.getRecordSet("lasttentrxn");
    } catch (Exception e) {
    e.printStackTrace();
    e.getMessage();
    File csvFile;
    FileOutputStream file;
    //codes to generate a file in local server for downloading
    Calendar calendar = Calendar.getInstance();
    String strFileName = Integer.toString(calendar.get(Calendar.YEAR))+Integer.toString(calendar.get(Calendar.MONTH))+Integer.toString(calendar.get(Calendar.DATE))+Integer.toString(calendar.get(Calendar.HOUR))+Integer.toString(calendar.get(Calendar.MINUTE))+Integer.toString(calendar.get(Calendar.SECOND))+Integer.toString(calendar.get(Calendar.MILLISECOND));
    try {
    strFileName = DeformatAcctNo(req.getParameter("acct_trxn__acctselected")) + strFileName + ".csv";
    } catch (Exception e) {}
    calendar = null;
    csvFile = new File(strFileName);
    if (!csvFile.exists()) {
    csvFile.createNewFile();
    file = new FileOutputStream(csvFile);
    res.setContentType("application/download");
    res.setHeader("Content-Disposition","attachment;filename=" + strFileName);
    javax.servlet.ServletOutputStream servletoutputstream1 = res.getOutputStream();
    String s = strFileName;
    dumpFile(s, servletoutputstream1);
    servletoutputstream1.flush();
    servletoutputstream1.close();

    Hi,
    Thanx a lot for ur solution..it's helful for me to send data with a file format,but i need t send data in csv file foramt.
    hav a look at my complete servelt and try to suggesst some thing..
    In this case csv file is creating in c:\bea\wlserver directory.my intensions sre just it jas to download to client, no copy in the server.
    public class AcctStmtD2 extends HttpServlet {
         public void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException {
         //variables for retrieving last balance
         Message resultMessageLastBalance = null;
         RecordSet rsTrxnDetailLastBalance = null;
         double dblDebitTotal = 0.00;
         double dblCreditTotal = 0.00;
         HttpSession session = req.getSession(true);
    Enumeration ea = session.getAttributeNames();
         while(ea.hasMoreElements()) {
         Object name = ea.nextElement();
         System.out.println("values = " + session.getAttribute((String)name));
         try {
         resultMessageLastBalance = mtdRetrieveLastBalance(req);
         rsTrxnDetailLastBalance = resultMessageLastBalance.getRecordSet("formonthtrxn");
         } catch (Exception e) {
         e.printStackTrace();
         e.getMessage();
         File csvFile;
         FileOutputStream file;
         //codes to generate a file in local server for downloading
         Calendar calendar = Calendar.getInstance();
         String strFileName = Integer.toString(calendar.get(Calendar.YEAR))+Integer.toString(calendar.get(Calendar.MONTH))+Integer.toString(calendar.get(Calendar.DATE))+Integer.toString(calendar.get(Calendar.HOUR))+Integer.toString(calendar.get(Calendar.MINUTE))+Integer.toString(calendar.get(Calendar.SECOND))+Integer.toString(calendar.get(Calendar.MILLISECOND));
         try {
              strFileName = DeformatAcctNo(req.getParameter("acct_stmt__acctselected")) + strFileName + ".csv";
         } catch (Exception e) {}
         calendar = null;
         csvFile = new File(strFileName);
         if (!csvFile.exists()) {
         csvFile.createNewFile();
         file = new FileOutputStream(csvFile);
         if (rsTrxnDetailLastBalance.getTotalRowCount() >= 1) {
         String strLastBal = "";
         String strCurrCd = "";
              try {
                        rsTrxnDetailLastBalance.moveLast();
         strLastBal = rsTrxnDetailLastBalance.getValue("bal");
                        rsTrxnDetailLastBalance.moveFirst();
         strCurrCd = "(" + GetCurrCdFromSession(session, req.getParameter("acct_stmt__acctselected")) + ")";
         file.write(("\""+req.getParameter("acct_stmt__acctselected")+"\"").getBytes());
         file.write(',');
         file.write(',');
         file.write(',');
         file.write(',');
         file.write(',');
         file.write(("\""+"Last Balance "+strCurrCd+" = "+strLastBal+"\"").getBytes());
         file.write('\n');
         file.write(("\""+"Date"+"\"").getBytes());
         file.write(',');
         file.write(("\""+"Slip No"+"\"").getBytes());
         file.write(',');
         file.write(("\""+"Description"+"\"").getBytes());
         file.write(',');
         file.write(("\""+"Debit"+" "+strCurrCd+"\"").getBytes());
         file.write(',');
         file.write(("\""+"Credit"+" "+strCurrCd+"\"").getBytes());
         file.write(',');
         file.write(("\""+"Balance"+" "+strCurrCd+"\"").getBytes());
         file.write('\n');
         } catch (Exception e) {System.out.println("!");}
    while(rsTrxnDetailLastBalance.moveNext()) {
         try {
         file.write(("\""+rsTrxnDetailLastBalance.getValue("txn_dt").substring(0,12)+"\"").getBytes());
    file.write(',');
         file.write(("\""+rsTrxnDetailLastBalance.getValue("slip_no")+"\"").getBytes());
         file.write(',');
         file.write(("\""+rsTrxnDetailLastBalance.getValue("dscp")+"\"").getBytes());
         file.write(',');
         file.write(("\""+rsTrxnDetailLastBalance.getValue("debit")+"\"").getBytes());
         file.write(',');
         file.write(("\""+rsTrxnDetailLastBalance.getValue("credit")+"\"").getBytes());
         file.write(',');
         file.write(("\""+rsTrxnDetailLastBalance.getValue("bal")+"\"").getBytes());
         file.write('\n');
         } catch(Exception e) {}
         try {
                             dblDebitTotal += Double.parseDouble(rsTrxnDetailLastBalance.getValue("debit"));
         } catch (Exception e) {
                             dblDebitTotal = 0;
         try {
                             dblCreditTotal += Double.parseDouble(rsTrxnDetailLastBalance.getValue("credit"));
         } catch (Exception e) {
                             dblCreditTotal = 0;
         file.write(',');
         file.write(',');
         file.write(("\""+"Total"+"\"").getBytes());
         file.write(',');
         file.write(("\""+Double.toString(dblDebitTotal)+"\"").getBytes());
         file.write(',');
         file.write(("\""+Double.toString(dblCreditTotal)+"\"").getBytes());
         } else {
         file.write(("\""+"No Record Found!"+"\"").getBytes());
         file.close();
         res.setContentType("application/download");
         res.setHeader("Content-Disposition","attachment;filename=" + strFileName);
                   javax.servlet.ServletOutputStream servletoutputstream1 = res.getOutputStream();
         String s = strFileName;
         dumpFile(s, servletoutputstream1);
         servletoutputstream1.flush();
         servletoutputstream1.close();
    public void doPost(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException {
              doGet(req, res);
    private void dumpFile(String s, OutputStream outputstream) {
    byte abyte0[] = new byte[4096];
         boolean flag = true;
         try {
         FileInputStream fileinputstream = new FileInputStream(s);
         int i;
         while((i = fileinputstream.read(abyte0)) != -1)
         outputstream.write(abyte0, 0, i);
         fileinputstream.close();
         } catch(Exception e) {}
    private Message mtdRetrieveLastBalance(HttpServletRequest req) throws Exception {
         Message msgMessage = new Message();
         DAC.Parser.RecordSet objFund_Tx = msgMessage.createRecordSet("formonthtrxn");
         //Set the header fields for the record
         objFund_Tx.addHeaderFields("acctselected","String");
         objFund_Tx.addHeaderFields("formonth","String");
         objFund_Tx.addHeaderFields("foryear","String");
         //Add a new row to the recordset
         objFund_Tx.addRow();
         msgMessage.setData("recordnm", "string", "formonthtrxn");
         //Set the required fields into the recordset
         objFund_Tx.setValue("acctselected", DeformatAcctNo(req.getParameter("acct_stmt__acctselected")));
         objFund_Tx.setValue("formonth", req.getParameter("acct_stmt__formonth"));
         objFund_Tx.setValue("foryear", req.getParameter("acct_stmt__foryear"));
         objFund_Tx.setStatus("select");
         System.out.println("JSP IN :"+msgMessage);
         msgMessage = mtdOpenConnection(msgMessage);
         System.out.println("JSP OUT :"+msgMessage);
         return msgMessage;
    private Message mtdOpenConnection(Message objMessage) throws Exception {
    java.util.Hashtable ht = new java.util.Hashtable();
         ht.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
         ht.put(javax.naming.Context.PROVIDER_URL, "t3://localhost:7001");
    javax.naming.InitialContext ic = new javax.naming.InitialContext(ht);
    DAC.BusinessObjects.RIB.Account.AccountHome pmHome = (DAC.BusinessObjects.RIB.Account.AccountHome)PortableRemoteObject.narrow(ic.lookup("AccountEJB"),Class.forName("DAC.BusinessObjects.RIB.Account.AccountHome"));
         DAC.BusinessObjects.RIB.Account.Account pmObj = (DAC.BusinessObjects.RIB.Account.Account)PortableRemoteObject.narrow(pmHome.create(),Class.forName("DAC.BusinessObjects.RIB.Account.Account"));
         return pmObj.mtdRetrieveTrxForMonth(objMessage);
    private String convertSingleDigitMonthDayToDouble(String param) throws Exception {
         if (param.length() > 1) {
         return param;
         } else {
         return "0" + param;
         //remove dashes and product name and branch code from string
         private String DeformatAcctNo(String strAcctNo) throws Exception {
              strAcctNo.trim();
              return strAcctNo.substring(0,3)+strAcctNo.substring(4,6)+strAcctNo.substring(7,12)+strAcctNo.substring(13,14);
         private     String GetCurrCdFromSession(HttpSession session, String acct_no) throws Exception {
              String strAcctDetail = "";
              String strCurrCd = "";
              Vector vList = (Vector)session.getAttribute("accountlist");
              for (int i = 0; i < vList.size(); i++) {
                   strAcctDetail = (String)vList.get(i);
                   if ((strAcctDetail.substring(0, acct_no.length()).equals(acct_no))) {
                        strCurrCd = strAcctDetail.substring(strAcctDetail.indexOf(":") + 1, (strAcctDetail.indexOf(":") + 4));
                        break;
              vList = null;
              strAcctDetail = null;
              return strCurrCd;
    }

  • CSV file downloading replaces the parent window

    Hi,
    I'm trying to download a .csv file from my web application using Content-Disposition
    here is my code
    response.setContentType("application/octet-stream");
    filename = filename.concat(downloadType);
    response.setHeader("Content-Disposition","attachment; filename="+filename+";");
    //response.setHeader("Content-Disposition","application/octet-stream; filename="+filename+";");
    String source = (String)ivHttpRequest.getAttribute("downloadFile");
    if(downloadType.equals(".txt")) {
    source = Utils.decodeHtmlEntities(source);
    byte [] byteArray;
    if(source == null)
    // use ivRequest instead
    String source2 = (String)ivRequest.getAttribute("downloadFile");
    if(downloadType.equals(".txt")){
    source2 = Utils.decodeHtmlEntities(source2);
    byteArray = source2.getBytes();
    else
    byteArray = source.getBytes();
    ServletOutputStream out = response.getOutputStream();
    out.write(byteArray);
    out.close();
    I'm able to download the file in all the browsers, But while using IPAD the content of the file replaces the existing window (Parent Window) without asking for Save or Open option. So i'm unable to get the parent window again.
    Please let me know is there any special content type or anythinmg else i have to change.. So that i could be able to open the csv file in a new tab without replacing the parent window.The problem i faced only with IPAD

    Hi,
    For pdf file if we choose adhoc or by giving the proper name, we can able to get the options like OPEN or SAVE. This will work fine for pdf.
    But here im trying with csv file /html file, so the file is replacing the existing screen itself when i click the csv link. In my web application, i cannot get the parent window by using back button once i get the csv file instead page gets expired.
    So my best suggestion is should we able to open the csv file in new Tab of safari instead of replacing the parent window where im clicking to open the csv file.
    Suggestions pls.

  • CSV file download takes long time

    Hi all,
    i have an interactive report and there is Download link to file in different formats.
    My query is long running query it took almost 3 mins to execute and show in the region .
    When i want to download the report in CSV format it also took the same time as the query needs to executed.
    My Question ? is why it took the same time download? is it querying DB again to save in CSV?
    How the download to CSV can be faster within seconds.
    Please help me.
    adnan

    is it querying DB again to save in CSV?Yes. Depending on the report pagination property, the screen might showing a subset of the data, the CSV export function has to re-execute the query in order to generate the CSV file. Try tuning the query so it runs faster.
    If you are using IE, I see that the right-click menu has a Export to Excel option; that seems to export just the data you see on the screen, not sure how IE implements that but just thought I would point it out to see if it helps in your situation.

  • CSV file Download

    Hi folks,
    I would like to achieve the following functionality (in order)
    1. Query DB
    2. Parse results returned into CSV format (perhaps, in a stringbuffer or file)
    3. Return the CSV file or string to the client
    4. Display a pop up window to the user allowing the user to download file.
    How do I implement steps 3 and 4? I would really appreciate some sample code.
    Cheers,
    Rahul

    hi shipla,
    I ended up using the ByteArrayOutputStream...It seems to work well for now, lemme know if tehre are any issues regarding this. Thanks...
    java.io.ByteArrayOutputStream outStream = new java.io.ByteArrayOutputStream();
    outStream.write(csv.toString().getBytes());
    _ctx.getResponse().setHeader("Content-disposition","attachment;filename=test.csv");
    _ctx.getResponse().setContentType("application/excel");
    _ctx.getResponse().setContentLength(outStream.size());
    outStream.writeTo(_ctx.getResponse().getOutputStream());
    _ctx.getResponse().getOutputStream().flush();                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • URL iViews & File Download error.

    Hi Gurus,
    I am having a strange problem. I am having a URL iView and this is pointing to a site and whenever user  visit this iView, it gives file download dialog box. And the message which appears “Some files can harm your computer. If the ……”. Very typical message.
    Let me take an example here.
    I have an URL iView which is pointing to say https://www.sdn.sap.com, and this URL (in mine case also) get resolved to “https://www.sdn.sap.com/irj/sdn”. But will give me an error message as mentioned above with following information:
    Some files can harm your computer. If the ……”.
    File Name: sdn
    File Type:
    From: www.sdn.sap.com
    With four buttons “Open”, “Save”, “Cancel”, “More Info”.
    I tried all the settings of the Explorer like trusted sites etc etc but no use.
    Can someone throw some light.

    Hi,
    This could be a proxy setting problem on your server.
    Check this:
    http://help.sap.com/erp2005_ehp_03/helpdata/EN/8d/8e0c7e477e4239a7ee288d7846a0bb/frameset.htm
    http://help.sap.com/erp2005_ehp_03/helpdata/EN/33/8abf9e0ce011d7b84900047582c9f7/frameset.htm
    Also check restarting the server.
    If this does not solve, also clear all temp files and cookies in the browser.
    Regards,
    Praveen Gudapati

  • Trying to update cc desktop on mac osx lion and keep getting file download error 204

    Hi ,
    I have Mac OSX Lion 10.7.5 and keep getting this error when trying to update my cc desktop app that is reporting an update. There seems to be a problem with the file download. For troubleshooting tips, please visit our customer support page.(Error code: 204)Contact Customer Support
    please resolve.

    I have the same problem and was on lots off sides of adobe, no answer then i searched in the log data and found this.
    06/21/14 19:04:06:710 | [INFO] |  | ACC | LBS | ApplicationFacade |  |  | 43925 | ****************Starting LBS workflow*******************
    06/21/14 19:04:06:715 | [INFO] |  | Download | LBS | ProductInfo |  |  | 43925 | Product locale not specified in the product information file
    06/21/14 19:04:06:715 | [INFO] |  | Download | LBS | ProductInfo |  |  | 43925 | Product name not specified in the product information file
    06/21/14 19:04:06:715 | [INFO] |  | Download | LBS | LBSUtils |  |  | 43925 | Launching LBS in elevated mode
    06/21/14 19:04:12:270 | [INFO] |  | ACC | LBS | ApplicationFacade |  |  | 43999 | ****************Starting LBS workflow*******************
    06/21/14 19:04:12:276 | [INFO] |  | ACC | LBS | WorkflowManager |  |  | 43999 | LBS launched in LEGACY mode
    06/21/14 19:04:12:399 | [INFO] |  | Download | LBS | SystemCheck |  |  | 44009 | System OS Version - major = 10, minor = 7, bugFix = 5
    06/21/14 19:04:12:399 | [INFO] |  | ACC | LBS | WorkflowManager |  |  | 44009 | ACCC System requirements check passed
    06/21/14 19:04:12:433 | [INFO] |  | Download | LBS | ProductInfo |  |  | 44009 | Product locale not specified in the product information file
    06/21/14 19:04:12:433 | [INFO] |  | Download | LBS | ProductInfo |  |  | 44009 | Product name not specified in the product information file
    06/21/14 19:04:12:433 | [INFO] |  | ACC | LBS | WorkflowManager |  |  | 44009 | Bootstrap LBS is successful
    06/21/14 19:04:12:451 | [INFO] |  | ACC | LBS | WorkflowManager |  |  | 44009 | Bootstrapper Lock acquired
    06/21/14 19:04:12:469 | [INFO] |  | ACC | LBS | WorkflowManager |  |  | 44009 | LBS Lock acquired
    06/21/14 19:04:12:501 | [INFO] |  | ACC | LBS | WorkflowManager |  |  | 44009 | Deployment lock check passed
    06/21/14 19:04:12:519 | [INFO] |  | ACC | LBS | WorkflowManager |  |  | 44009 | The resolved URL for package service is https://prod-rel-ffc.oobesaas.adobe.com/adobe-ffc-external/core/v1/applications?name=Creat iveCloud&name=CCLBS&osVersion=10.7.5&platform=osx10
    06/21/14 19:04:14:236 | [INFO] |  | ACC | LBS | WorkflowManager |  |  | 44009 | Successfully downloaded application xml at path /tmp/912ACE51-6B35-48F6-9D63-D863680F0EE3/applications.xml
    06/21/14 19:04:14:314 | [INFO] |  | ACC | LBS | WorkflowManager |  | FileUtils | 44009 |
    06/21/14 19:04:14:314 | [ERROR] |  | ACC | LBS | PDM | PackageDownloadManager |  | 44009 | Failed to create folder at temp location for download operations
    06/21/14 19:04:15:143 | [ERROR] |  | ACC | LBS | PDM | PackageDownloadManager |  | 44033 | Could not init xml parser with download manifest file at
    06/21/14 19:04:15:222 | [ERROR] |  | ACC | LBS | WorkflowManager |  |  | 44009 | PDM stopped with fatal error in downloading PIM with error -3
    06/21/14 19:04:15:344 | [ERROR] |  | ACC | LBS | WorkflowManager |  |  | 44009 | Failed in DOWNLOAD PIM
    06/21/14 19:07:19:779 | [INFO] |  | Download | LBS | ETS |  |  | 43999 | Waiting for the async thread to get the task completed
    06/21/14 19:07:19:788 | [INFO] |  | Download | LBS | ETS |  |  | 44013 | Async thread is completed. Now exiting from function.
    06/21/14 19:07:19:790 | [INFO] |  | ACC | LBS | ApplicationFacade |  |  | 43999 | ACC installation end with exit code: 214
    06/21/14 19:07:19:790 | [INFO] |  | ACC | LBS | ApplicationFacade |  |  | 43999 | ****************Closing LBS workflow*******************
    Adobe please help, it´s not the first problem installing updates in CC, i we pay for it !!!

  • Blank page shown instead of Open/Save As dialog box-CSV file download in IE

    I am migrating an application hosted earlier on Oracle 9iAS (9.0.3.1 BP1) to OracleAS 10g (10.1.3) with Struts 1.2.9. While the below JSP code worked for the earlier s/w stack when accessed using IE 5.5 SP2 or above, a blank page is displayed with the new s/w stack. What I mean by "worked earlier" is this. A "Open/Save As" dialog box would appear. Trying to "Open" would open a new IE window launching MS Excel and displaying correct data. Trying to "Save As" would display correct filename and extension in the dialog box.
    <%@page autoFlush="false" contentType="application/x-filler"%>
    <%
    try
    String fileName = "ABC.CSV";
    String strData = "A,B,C";
    response.setContentLength(strData.length());
    response.setHeader("Content-Type","application/octet-stream");
    response.setHeader("Content-Disposition","inline;filename="+fileName);
    ServletOutputStream ouputStream = response.getOutputStream();
    ouputStream.write(strData.getBytes(), 0, strData.getBytes().length);
    ouputStream.flush();
    ouputStream.close();
    catch(Exception e)
    %>
    I tried some changes listed below:
    1. Deliberately introduced compilation errors in the JSP code.
    2. Changed contentType="application/x-filler" to various MIME types like application/x-download, application/vnd.ms-excel, removing it altogether.
    3. Commented out response.setHeader("Content-Type","application/octet-stream") and also tried other MIME types related to CSV/Excel.
    4. Changed Content-Disposition from inline to attachment.
    Each of the above resulted in an unacceptable behaviour compared with the earlier state:
    1. Blank page shown as if nothing was happening even in case of deliberate incorrect JSP syntax.
    2. Dialog box did show up with some combinations. But on trying to "Open" or "Save As", the dialog box shows up a second time. Then while trying to "Open", the contents get opened either inline or in MS Excel but with some additional garbage data like source file name.jsp etc. While trying to "Save As" the file name and extension take on the pattern <URL_Pattern>.htm where URL_Pattern would be "DOWNLOAD_ACTION.do".
    Some other information:
    1. This code works when accessed from desktop local container (Win 2000) but not when deployed on Unix env (HP-UX B.11.11.0109).
    2. Latest patchsets are installed for IE.
    3. The existing application is designed to work for ONLY IE 5.5 SP2 or above, so I haven't tried with other browsers. I have tried both IE 5.5 SP2 and 6.0 SP1.
    Any help in this regard will be highly appreciated.
    Thanks a lot for your valuable time..

    I have made it to work with the below changes:
    1. Changed the URL pattern for <filter-mapping> for *.jsp to /*.jsp
    2. Added <dispatcher>REQUEST</dispatcher> and <dispatcher>FORWARD</dispatcher>
    3. Everything else (code-wise) is as before.
    Because of these changes, the filter, wherein some headers are being added to the response, is being invoked appropriately now.
    Thanks for you time and suggestion though...

  • Application Server File Download Error

    Hi Experts,
      i have tried downloading xml in to application server .. follwing the link in sdn.
    XML file creation in application server
    but while scheduling background job it gets cancelled and shows error message ' Error in Control Framewor ' in the log please help me on this..

    Could you please give little more details,like what are the transactions used,if possible please send a copy of the code of your program which you are scheduling as back groud job.
    Kind regards
    Manoj

  • ABAP2xlsx file download error

    I have got the nugget file for ABAP2XLSX class and imported it using ZSAPLINK. also i installed demo programs 'ZCl_ALV2XLSX_DEMO1' given by Zcl_alv2xlsx. When i execute that program it downloads a excel file in a format (.xls or .xlsx) but while opening the downloaded excel file it gives me a error message stating "EXcel cannot open the file ZCl_ALV2XLSX_DEMO1.xls because the file format or file extension is not valid. Verify that the file has not been corrupted and that the file extension matches the format of the file ".
    Please suggest a solution for this. <removed by moderator>
    Edited by: Thomas Zloch on Dec 17, 2011 10:48 PM

    Hi Ivan,
    I would try if I only could (and had the time).
    The [project site|https://cw.sdn.sap.com/cw/sources/1016?view=file-source&path=build%2Fabap2xlsx_Daily.nugg.zip] is extremely slow. I can not get the download (using Firefox latest version).
    Regards,
    Clemens

  • File download error

    Hi guys,
    I am using the FM 'GUI_DOWNLOAD' to download my internal table into a text file.
    But i am getting an error  " Access to file denied".
    Kindly help me out on this.
    Thanks and regards,
    Frank.

    Hi,
    Please check authorization with your system administrator for writting the file on your PC.

  • Why do CSV files downloaded to Excel appear as one sentence; Explorer converts to spreadsheet.

    Downloading census data from http://censtats.census.gov/cgi-bin/bldgprmt/bldgdisp.pl comes across in Explorer directly into Excel with all columns intact. When we use Firefox 3.6.8 it comes across as an old style csv, with "" and commas separating columnar data. How do we get Firefox to import csv into Excel spreadsheet so it doesn't have to be manipulated?

    *Dafizilla Table2Clipboard: https://addons.mozilla.org/firefox/addon/1852

Maybe you are looking for

  • Multiple copies of the same alert on SCOM console

    We have an Oracle EM Grid Control 11.1.0.1 installation and the SCOM connector is configured to send alerts to a SCOM 2007 R2 system. We note that every alert from OEM appears on the SCOM console 5 times (a minute late with each other), we suspect th

  • DIscount condition for plant to plant STO

    Hi, Please let me know if this requirement is possible in the system. My scenario is when I am transferring stock from plant to plant (both under same company code), I get a subsidy. So when I receive the goods in the receiving plant the price has to

  • Mass Change of Vendors - XK99

    Hello Experts, I am facing a strange problem with the Tcode XK99. I am trying to change the Purchasing group (LFM1-EKGRP) of the vendor through XK99. But some of the vendors are updated with new EKGRP but some vendors remains same. For example if I h

  • Blank Cells and Zeroes

    I am a teacher trying to use an iPad with iOS Numbers as a mobile gradebook. One issue I have is making a blank cell not count in sums and averages. When I enter a new assignment, the student automatically gets a zero until I enter his or her actual

  • Creating new Domain by Copying the existing domain

    Hi, Is there any way to create a new domain by copying the already existing domain directory and pasting it to another directory in same machine or different machine. Can anyone suggest me the configuration file that needs to be updated for new domai