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.

Similar Messages

  • CSV file replacing the parent window

    Joined: Dec 16, 2011
    Posts: 5
    posted    Friday, December 16, 2011 3:35:15 PM
    0
    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.
    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

    You are probably better off asking in the developer forums : https://devforums.apple.com/index.jspa

  • FireFox 4 and earlier versions will not install on my Windows Vista, 64 bit computer. The file downloads and the file extracts but I never make it to the installation wizard.

    I have tried to download FireFox 4 and earlier versions from several different website, thinking the files might have gotten corrupted, and each time I download the file the exact same thing happens, the file downloads and the file gets extracted but when the extraction completes the small window dissappears and nothing else happens.
    My machine is a Windows Vista 64 bit system and I've tried downloading the file with my 32 and 64 bit Internet Explorer but nothing seems to work. Can someone help me please because I would love to be able to completely delete I.E.

    Hi, thanks for your Flash file info. Well you must have been doing it right, since all of your Flash files for IE and FF are correct.
    The SWF plugin for FF and the SWO for IE are also correct.
    You shouldn't be having any problems with Flash Player.
    What you can try is to turn off the hardware acceleration feature. Go to any video, like youtube and right click on the video and click on Settings. Display Settings is where you will UN check hardware acceleration.
    See if that helps. Let me know.
    Thanks,
    eidnolb

  • When someone other than myself downloads an image from my web album, a dynamically generated file name replaces the original file name.  How I can prevent the original file name being replaced during the downloading process?

    When someone other than myself downloads an image from my web album, a dynamically generated file name replaces the original file name.  How I can prevent the file name being changed during this downloading process?

    Hi Glenyse,
    Here are my steps.
    1.  I upload multiple image (jpg) files onto my photo album.
    2.  I select the "sharing" by email option for this album.
    3.  I enter the recipient's email address.
    4.  The recipient receives my message and clicks on the link.
    5.  The recipient accesses my photo album and clicks on one of the images.
    6.  The image opens up to its own screen.
    7.  The recipient selects the "download" and then save file option.
    Here is the part I do not understand.  For some reason, during this "download" process, the original name which I have given to the file is replaced by different name.  So I was hoping that someone knows how to prevent the file name from being changed during the "download and save" process.
    Much appreciated if you can help me find a solution to this problem.
    Mary  

  • 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

  • Hi- I'm trying to install xcode 2.5. Idon't know what to do w/.exe file downloaded from the apple developer website

    Hi- I'm trying to install xcode 2.5. Idon't know what to do w/.exe file downloaded from the apple developer website.
    I would like to be able to use AU Lab but my developer folder only has extras/palettes inside- no applications or tools.
    Thanks

    Hello,
    What is the full name of this exe file?
    Those are for Windows®

  • 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

  • Passing Value from a Popup Window Back to the Parent Window

    I am using JSF. I try to pass a value that is entered by users in the popup window back to a text field in the parent window.
    quote: document.forms[ ].elements[ ] is null or not an object.
    The relevant code snippets are shown below. The screen1.jsp is the parent window:
             <script language="JavaScript1.1">
               function doPopup(source)
                    popup = window.open("externalFilePopup.jsp",
                        "popup",
                         "height=300,width=200,toolbar=no,menubar=no,"                    + "scrollbars=yes");
                    popup.openerFormId = source.form.id;
                    popup.focus();
               </script>
    <h:outputText value="Enter the external system file name"/>        <h:inputText value="#{dataManagementBean.ip}" size="18" />
    <h:commandButton value="..." onclick="doPopup(this); return false;" />
    ..........The externalFilePopup.jsp is the popup window:
            <script language="JavaScript1.1">
                function doSave( value )
                   var formId = window.openerFormId;
                   opener.document.forms[ formId ].elements[ formId + ":ip" ].value = value;
                   window.close();
            </script>
         <h:outputText value="IP Address: "/>
         <h:inputText size="25" value="#{dataManagementBean.ip }" required="true"/>
         <h:commandButton value="OK" onclick="doSave('#{dataManagementBean.ip}');"/>
            .......... The script error occurs when I click on this OK button.
    Please point out the mistakes in my code. Thank you.

    I have made some modifications to the code in the popup window. The error reported in my previous posting is gone. But, I still have several problems:
    1. syntax error in the popup window jsp page: line 45, char 21, syntax error, ..., Do you want to continue running script on this page?2. The popup window does not close after I click on the OK button that I coded in the popup window jsp.
    3. The value that I entered in the popup window eventually gets passed back to the text field in the parent window only if I re-run the application.
    The relevant JavaScript code snippets are:
            <script language="JavaScript1.1">
                function doSave( value )
                   var formId = window.openerFormId;
                   opener.document.forms[ formId ].form[ formId + ":ip" ].value = value;
                   window.close();
            </script>
                                       <h:outputText value="IP Address: "/>
         <h:inputText size="25" id="ip" value="#{dataManagementBean.ip }" required="true"/>
         <h:commandButton value="OK" onclick="doSave('ip'); return=false;"/>
    ......What are the mistakes that I made?

  • Open URL in a new window by closing the parent window

    Hi Friends,
    Is there any option to open URL in a new window by closing the parent window on a button click?
    Already implemented the logics suggested in /people/mohammed.anzys/blog/2007/06/05/how-to-close-parent-window-in-webdynpro-applications , the thread ' URL in same window '  and the standard component WDR_TEST_EXIT_PLUG .But button is not triggerring any actions .plz help me  ..............
    Regards,
    Radhika

    hi,
    Do the following steps :
    -> Make an Outbound Plug to the Window.
    ->Make the type of Outbound plug to Exit Type.
    ->Add URL of type String as a parameter to the outbound plug of Window.
    ->Do remember to add Component Name in the Properties Tab of View ( othervs Calling Outbound plug of window from view wont b possible ).
    To open a new URL with closing the previous one write this Code in OnAction of Button : ( this Code can be get from Code Wizard too ).
    DATA lo_zexit TYPE REF TO ig_zexit .   <zexit is name of my Component>
    lo_zexit =   wd_this->get_zexit_ctr( ).
      lo_zexit->fire_out_window_plg(
        url =   'http://www.google.com'                            " string
    I hope it helps.
    Thanx.

  • How do I install a new system file to replace the damaged one

    I am tring to repair the permissions on my computer and am getting all of these types of errors. Computer is dragging. I reinstalled my operating system and this is what is happening. Any suggestions. Happening on my desk top I Mac and on my Mac Book. I did google search and Error 23 is "These errors indicate that the Mac tried to access one of the standard routines in the system file and couldn't find it. In all probability, that means you have a corrupted system file. Try installing a new system file to replace the damaged one."
    Here is a sample of what disk utilities says
    Open error 23: "Too many open files in system" on System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/doc /activesupport-2.3.5/ri/ActiveSupport/CoreExtensions/Array/Conversions/cdesc-Con versions.yaml
    Open error 23: "Too many open files in system" on System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/doc /activesupport-2.3.5/ri/ActiveSupport/CoreExtensions/Array/Conversions/to_format ted_s-i.yaml
    Open error 23: "Too many open files in system" on System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/doc /activesupport-2.3.5/ri/ActiveSupport/CoreExtensions/Array/Conversions/to_param- i.yaml
    Open error 23: "Too many open files in system" on System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/doc /activesupport-2.3.5/ri/ActiveSupport/CoreExtensions/Array/Conversions/to_query- i.yaml
    Open error 23: "Too many open files in system" on System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/doc /activesupport-2.3.5/ri/ActiveSupport/CoreExtensions/Array/Conversions/to_senten ce-i.yaml
    Open error 23: "Too many open files in system" on System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/doc /activesupport-2.3.5/ri/ActiveSupport/CoreExtensions/Array/Conversions/to_xml-i. yaml
    Open error 23: "Too many open files in system" on System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/doc /activesupport-2.3.5/ri/ActiveSupport/CoreExtensions/Array/ExtractOptions
    Open error 23: "Too many open files in system" on System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/doc /activesupport-2.3.5/ri/ActiveSupport/CoreExtensions/Array/ExtractOptions/cdesc- ExtractOptions.yaml"
    It says it should be done in 6 minutes and I am going on hours!
    Permissions differ on "System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Support/Rem ote Desktop Message.app/Contents/Resources/zh_TW.lproj/UIAgent.nib", should be drwxr-xr-x , they are -rwxr-xr-x .
    Repaired "System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Support/Rem ote Desktop Message.app/Contents/Resources/zh_TW.lproj/UIAgent.nib".
    Permissions differ on "System/Library/CoreServices/RemoteManagement/AppleVNCServer.bundle/Contents/Su pport/LockScreen.app/Contents/Resources/zh_TW.lproj/MainMenu.nib", should be drwxr-xr-x , they are -rwxr-xr-x .
    Repaired "System/Library/CoreServices/RemoteManagement/AppleVNCServer.bundle/Contents/Su pport/LockScreen.app/Contents/Resources/zh_TW.lproj/MainMenu.nib".
    Permissions differ on "System/Library/CoreServices/RemoteManagement/AppleVNCServer.bundle/Contents/Su pport/LockScreenLeopard386.app/Contents/Resources/zh_TW.lproj/MainMenu.nib", should be drwxr-xr-x , they are -rwxr-xr-x .
    Repaired "System/Library/CoreServices/RemoteManagement/AppleVNCServer.bundle/Contents/Su pport/LockScreenLeopard386.app/Contents/Resources/zh_TW.lproj/MainMenu.nib".
    Permissions differ on "System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Support/Rem ote Desktop Message.app/Contents/Resources/zh_CN.lproj/UIAgent.nib", should be drwxr-xr-x , they are -rwxr-xr-x .
    Repaired "System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Support/Rem ote Desktop Message.app/Contents/Resources/zh_CN.lproj/UIAgent.nib"."
    Any suggestions?

    I would apply or reapply the 10.6.8. Combo Update from Safe Boot (hold Shift down at startup -- give it much more time to boot than usual and leave it in SB for a few minutes before doing anything.)
    http://support.apple.com/kb/dl1399
    The messages you are seeing beginning with "Permissions differ on...." can be ignored.

  • How to pass the data from a pop up window to the parent window

    Hi All,
    I have a jsp page which contains a add button, while clicking it a popup will come out(which is a another jsp page). There are some input fieldsand a submit button. Now how could I send the data from the pop up to the parent winow. Also I have to check that if the pop up is open and I click add button then another pop up must not open.
    Plz reply its urgent
    Thanks and Regards
    Rajib Sharma

    Thanks for the reply
    But it not worked
    I have a jsp page and the popup is also a jsp page the data that is passed from the popup window to the parent must be send to the server from the parent window to get a data from the data base as search result. Its of no use to get it as js data
    Thanks and regards
    Rajib Sharma

  • How to Compare 2 CSV file and store the result to 3rd csv file using PowerShell script?

    I want to do the below task using powershell script only.
    I have 2 csv files and I want to compare those two files and I want to store the comparision result to 3rd csv file. Please look at the follwingsnap:
    This image is csv file only. 
    Could you please any one help me.
    Thanks in advance.
    By
    A Path finder 
    JoSwa
    If a post answers your question, please click &quot;Mark As Answer&quot; on that post and &quot;Mark as Helpful&quot;
    Best Online Journal

    Not certain this is what you're after, but this :
    #import the contents of both csv files
    $dbexcel=import-csv c:\dbexcel.csv
    $liveexcel=import-csv C:\liveexcel.csv
    #prepare the output csv and create the headers
    $outputexcel="c:\outputexcel.csv"
    $outputline="Name,Connection Status,Version,DbExcel,LiveExcel"
    $outputline | out-file $outputexcel
    #Loop through each record based on the number of records (assuming equal number in both files)
    for ($i=0; $i -le $dbexcel.Length-1;$i++)
    # Assign the yes / null values to equal the word equivalent
    if ($dbexcel.isavail[$i] -eq "yes") {$dbavail="Available"} else {$dbavail="Unavailable"}
    if ($liveexcel.isavail[$i] -eq "yes") {$liveavail="Available"} else {$liveavail="Unavailable"}
    #create the live of csv content from the two input csv files
    $outputline=$dbexcel.name[$i] + "," + $liveexcel.'connection status'[$i] + "," + $dbexcel.version[$i] + "," + $dbavail + "," + $liveavail
    #output that line to the csv file
    $outputline | out-file $outputexcel -Append
    should do what you're looking for, or give you enough to edit it to your exact need.
    I've assumed that the dbexcel.csv and liveexcel.csv files live in the root of c:\ for this, that they include the header information, and that the outputexcel.csv file will be saved to the same place (including headers).

  • How to get the parent window in sub-child controller class in javafx?

    how to get the parent window in sub-child controller class in javafx?

    You can get the window in which a node is contained with
    Window window = node.getScene().getWindow();Depending when this is invoked, you might want to check the Scene is not null before calling getWindow().
    If the window is a stage that is owned by another window, you can get the "parent" or "owner" window with
    Window owner = null ;
    if (window instanceof Stage) {
      Stage stage = (Stage) window ;
      owner = stage.getOwner();
    }

  • Loop through a csv file and return the number of rows in it?

    What would be simplest way to loop through a csv file and
    return the number of rows in it?
    <cffile action="read" file="#filename#" output="#csvstr#"
    >
    <LOOP THROUGH AND COUNT ROWS>

    ListLen(). Use chr(13) as your delimiter

  • Loading a CSV file and accessing the variables

    Hi guys,
    I'm new to AS3 and dealt with AS2 before (just getting the grasp when the change it).
    Is it possible in AS3 to load an excel .csv file into Flash using the URLLoader (or ???) and the data as variables?
    I can get the .csv to load and trace the values (cell1,cell2,cell3....) but I'm not sure how to collect the data and place it into variables.
    Can I just create an array and access it like so.... myArray[0], myArray[1]? If so, I'm not sure why it's not working.
    I must be on the completely wrong path. Here's what I have so far....
    var loader:URLLoader = new URLLoader();
    loader.dataFormat = URLLoaderDataFormat.VARIABLES;
    loader.addEventListener(Event.COMPLETE, dataLoaded);
    var request:URLRequest = new URLRequest("population.csv");
    loader.load(request);
    function dataLoaded(evt:Event):void {
        var myData:Array = new Array(loader.data);
        trace(myData[i]);
    Thanks for any help,
    Sky

    just load your csv file and use the flash string methods to allocate those values to an array:
    var myDate:Array = loader.data.split(",");

Maybe you are looking for