Problem With File Download Dialog Box

Hi all,
I have jsp page that allows a user to export oracle data to excel.
I have these code in my page:
<%@ page contentType="application/vnd.ms-excel" %>
response.setContentType ("application/vnd.ms-excel");
response.setHeader ("Content Disposition",
"filename=\"historicalrate.xls\"");
I run the page and it popups a file download dialog box with Open and Save buttons.
When I click the Save button a Save As window opens with a hr.xsl file name and Microsoft Excel Workbook(*.xls) as save type. It is what I want.
The problem I have is when I click the Open button on the file download dialog box it displays data in excel format on a browser well. Then I click File > save as on browser's tool bar the Save As window pop up with no file name and a default Text(tab delimited)(*.txt).
I need the file name and Microsoft Excel Workbook(*.xls) as default save type.
Any help would be greatly appreciated.
Please help
Thanks

I have the same problem with hui_ling.
When user click on "Open", Excel start and open excel file correctly but the file name on excel title bar. 'Cause the file name is in Japanese characters. Any one can help me?
Message was edited by:
TNTVN

Similar Messages

  • Problem with File Open Dialog box

    Gurus,
    I am using Forms 10g with Windows environment .. My requirement is, to display File Open Dialog Box, and whatever file I am selecting it has to open .. I am able to get Dialog box, problem is, when I select a file (for example, test.txt), I cant see the file getting opened .. Can anyone suggest me how to get the desired result ...
    Pasting my code below
    declare
         a varchar2(100);
    begin
         a := WEBUTIL_FILE.FILE_SELECTION_DIALOG('c:\temp','','*.*','c:\temp',OPEN_FILE, TRUE);
    end;
    Regards

    You can see the code in the webutil.pll library.
    FUNCTION CLIENT_GET_FILE_NAME (directory_name Varchar2 := NULL,
                                   file_name      Varchar2 := NULL,
                                   file_filter    Varchar2 := NULL,
                                   message        Varchar2 := NULL,
                                   dialog_type    Number   := OPEN_FILE,
                                   select_file    Boolean  := TRUE) return Varchar2 is                             
    * CLIENT_GET_FILE_NAME
    *   Client (Browser) side implementation of the standard GET_FILE_NAME Built-in
    *   Used to display File Open, Save  and directory listing dialogs
    *   Implemented using calls to WEBUTIL_FILE
    * Version 1.0.0
    * Change History
    *   1.0.0 DRMILLS 23/DEC/2002 - Creation
    \*********************************************************************************/ Here is one example:
    the_file := client_get_file_name('c:/', null, 'All Files (*.*)|*.*|',null,open_file,true);Francois

  • File download dialog box problem!

    Hi,
    How do you force file download message box to use specified file name instead of JSP or servlet name.
    I am using:
    // code in attachment.jsp
    <%
    response.setContentType(mimeType.trim());
    response.setHeader("Content-Disposition","attachment;filename=\""+attachmentViewBean.getAttachmentName()+ "\"");
    %>
    With the above code, browser first pop up file download dialog box informing
    'You are downloading the file:[attachment.jsp] from host. Would u like to open the file or save?'
    I want the file name that I had specified in setHeader("Content-disposition","attachment;filename=resume.doc") to appear(i.e. resume.doc) in above dialog box and not the servlet name.
    Any suggestions/tips on this?
    Your help would be greatly appreciated.
    Thanks,
    Yogesh

    For saving the document I have used -
    res.setHeader("Content-disposition", "attachment; filename="+ FileName );
    and it is working very fine, it saves the document with name specified in FileName
    For opening the file in browser without any prompt-
    res.setHeader("Content-disposition", "inline" );
    For setting the content type -
    try {
         if(FileType.equalsIgnoreCase("pdf")) contentType = "application/pdf";
         if(FileType.equalsIgnoreCase("doc")) contentType = "application/msword";
         if(FileType.equalsIgnoreCase("rtf")) contentType = "application/msword";
         if(FileType.equalsIgnoreCase("gif")) contentType = "image/gif";
         if(FileType.equalsIgnoreCase("jpg")) contentType = "image/jpeg";
         if(FileType.equalsIgnoreCase("html")) contentType = "text/html";
         if(FileType.equalsIgnoreCase("htm")) contentType = "text/html";
         if(contentType == null){
         contentType="text/plain";
         res.setContentType(contentType);
    } catch (Exception e){
              out.println("Exception while setting content type");
              out.println("Exception : " + e);
              return;
    Hope this helps

  • File Download Dialog Box

    Hi,
    I am creating a site using struts framework. In that one I code one "Download" hyperlink. Which should download Excel file to the client site.
    For this I want the Windows File Download Dialog Box to pop up when the user presses the "Download"
    hyperlink on the page. This is the dialog box which prompts the user to either open the file or save
    the file.
    However, instead of File download dialog box, IE opens the text document within itself.
    From what I understand, if the Mime Type of the file I am trying to open is registered on the client
    workstation, then this dialog box wont pop up as Windows would automatically get the registered Mime
    Type from the registry and open the application. For this we need to add headers to http response (content-disposition). Where to add this header info. In JSP, Action classes?
    Can somebody help.
    Thanks

    I am facing a similar problem...however in my case my application is on Tomcat server and when the user clicks the link, he/she sees junk data (excel sheet data) in plain html which makes no sense (with lot of special chars, just like opening any binary file in notepad)
    while if i run the application in WSAD then the links work fine....is there any difference in both the servers in the way they treat file download?

  • File download dialog box events and work around

    Hi all,
    I have a amall problem.
    when i set content type and header for downloading a file which is generated from the server i get a "file download dialog box" (open/save/cancel)
    but the problem is i cannot capture the events i.e. if the client clicks 'cancel' since i cannot capture 'cancel' i cannot do some other modifications that need to be done when the file is not downloaded.
    is there any way which i can track if the file is actully downloaded by the client or not??
    Or is there any way i can just by pass this dialog box and get a "save as dialog box" which enables him to choose a location directly download to his hard drive.(In this case i ll get a javascript confirmation before actully creating the file)
    i am using IE6SP1.
    Thanks in advance for your support.

    Just using JSP/HTML/Javascript code I don't think there is a way to do what you want. You might be able to do so using a Java Web Start application - like a download manager.

  • Change File Name In The "File Download" Dialog Box For Web Reports

    Hi All ,
    I followed the below note to change the "File Download" name.
    How To Change The File Name In The "File Download" Dialog Box For Web Reports? Doc ID: Note:418366.1
    However its not working. Has anyone tried this and works fine ?
    Basically I wanted to change the name "rwservlet" when a report is run in an
    excel format.
    Rajesh Alex
    Rajesh Alex

    Hello,
    Have you checked if a HTTP header "Content-disposition" is returned ?
    You can use ieHTTPHEaders for IE
    http://www.blunck.se/iehttpheaders/iehttpheaders.html
    and
    Live HTTP Headers for FireFox
    https://addons.mozilla.org/en-US/firefox/addon/3829
    Regards

  • File download dialog box -running report

    I am calling one report from my Oracle 9i Developer Suite Application. When i call one report using 'delimited' format, the run runs okay opening in a new Internet Explorer(IE) instance. But, when i call another report, the File download dialog box -running report opens which asks whether u want to open the file or save it in your computer. I hope, my doubt is clear.Please help me in this as it is very urgent.
    Regards.

    This is a duplicate post. Please followup on your previous posting.
    What is the URL you specify?

  • Urgent!!how to open the file download dialog box????

    Hi all,
    i'm using the browse button for the user to select the file
    and a submit button, which when cliked should open the file
    download dialog box asking for open or save.
    i searched for so many forums and websites and didn't get the
    solution yet.
    i'm using jsp.
    anyone have the jsp code for the same????
    will b more helpful if u send it to me.
    thanx in advance.

    Hi
    Use the Filedialog class.
    Let your button call a method wich contains the following Java code:
    FileDialog filedialog =
    new FileDialog( Frame1.this, "Open a File", FileDialog.LOAD );
    //witch calls this constructor: public FileDialog(Frame parent, String title, int mode)
    //use Filedialog.SAVE to save a file.
    filedialog.show();
    String filename = filedialog.getFile();//to display the name of the file
    String directoryname = filedialog.getDirectory();// to display the directory name

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

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

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

  • Problem in file download dialog

    Hi,
    I am using the following code to download a PDF file. (Whiich is present in the database and I am retriving it using JDBC call).
                        InputStream in = null;
                        HttpServletResponse response = ctx.response();
                        response.setContentType ("application/pdf");
                        response.setHeader("Content-Disposition", "attachment; filename=\"" + fileName + "\"");
                        in = (InputStream)requestHandler.read(rparams);
                        byte[] buf = new byte[4096];
                        int len;
                        while((len = in.read(buf)) > 0)
                             out.write(buf, 0, len);
                        in.close();
                        out.flush();
                        out.close();                    
                        response.flushBuffer();
    Now when user is clicking on the specified link, file download dialog is coming, if user clicks on save the file is getting saved successfully but if user clicks on OK, it is giving the error, "There was an error opening this document. The file does not exist".
    Could anyone tell me what may be the problem in the code?
    Thanks in advance
    Amit

    Following code is returning the InputStream object:
         Blob document = null;
         QueryManager qm = null;
         int status = -1;
         InputStream dataStream = null;
         String sqlReadDocument = "select document from opr_t_aw_documents where id='"+id+"' and end_date > sysdate";
         log.debug("sqlReadDocument is "+sqlReadDocument);
              try
                   qm = new QueryManager();
                   ArrayList inParams = new ArrayList();
                   ResultSet result;
                   result = qm.performPrepQuery(sqlReadDocument, inParams);
                   if(result != null)
                        while(result.next())
                             document = result.getBlob(1);
                             if(document != null)
                                  dataStream = document.getBinaryStream();
    and out is simply response.getOutputStream().
    Please let me know in case you need any further info.
    Thanks,
    Amit

  • I am using Windows XP SP3, I have problem with file download while resuming downlod giving error "file...could not be saved, because the source file could not be read." Please help me

    I am using Fire Fox 5 beta version. After pausing the long file download, when I press the Resume download button the above message appear each time asking "Contact to Administrator". This problem was not with Fire Fox version 3 and above. Please Help Immediately. Thanks in advance...

    It is possible that your anti-virus software is corrupting the downloaded files or otherwise interfering with downloading files by Firefox.
    Try to disable the real-time (live) scanning of files in your anti-virus software temporarily to see if that makes downloading work.
    * http://kb.mozillazine.org/Unable_to_save_or_download_files

  • Problem with file download option in ALV via ITS. Please help!

    Hi Experts,
           I have a ALV report which I have web enabled using ITS service. In the ALV there is a delivered functionality for file download. It works fine when the report is run in the SE80. But when I run the ITS service for the report and choose file download option it displays a page saying "this page has been diaplayed due to technical reasons" with title "File properties". In addition it looks for Java runtime in the browser. After all this it opens a popup window for selecting path and file name.
    This is not user friendly and many customers have rasied their concerns on it.
    My question is that,
    Q1: What is the need of this "File properties page"? Why ITS calls this while ABAP editor does not?
    Q2: Is there any way we can suppress this so that it directly opens a popup window for selecting path and file name?
    Please help me.
    Thanks
    Gopal

    Hello Klaus,
    i have also the problem with these intermediate screens!
    We have in between installed patch 22 for ITS 6.20 and SP18 at SAP Netweaver 2004!
    But they are still not processed invisible for the users.
    Are there any additional parameters, which controls this behaviour(~webgui_updown_make_visible is not used!)?
    How can i check, if i have really a.ex. the actual ws.jar-file or other related files of the patch?
    We are using the standalone ITS with an own (modified) IAC with an own CI-design for the webpages. The intermediate screens are displayed with the "normal" SAPGUI-design because of the parameter ~generatedynpro. Without this it does not work, because the template SAPLSIT_0100 is missing!
    Or do you have an example for such a intermediate template with the applet for an upload of a file?
    Thanks in advance
    Felix

  • Problem with File download in ALV via ITS. Please help!

    Hi Experts,
           I have a ALV report which I have web enabled using ITS service. In the ALV there is a delivered functionality for file download. It works fine when the report is run in the SE80. But when I run the ITS service for the report and choose file download option it displays a page saying "this page has been diaplayed due to technical reasons" with title "File properties". In addition it looks for Java runtime in the browser. After all this it opens a popup window for selecting path and file name.
    This is not user friendly and many customers have rasied their concerns on it.
    My question is that,
    Q1: What is the need of this "File properties page"? Why ITS calls this while ABAP editor does not?
    Q2: Is there any way we can suppress this so that it directly opens a popup window for selecting path and file name?
    Please help me.
    Thanks
    Gopal

    Hello Klaus,
    i have also the problem with these intermediate screens!
    We have in between installed patch 22 for ITS 6.20 and SP18 at SAP Netweaver 2004!
    But they are still not processed invisible for the users.
    Are there any additional parameters, which controls this behaviour(~webgui_updown_make_visible is not used!)?
    How can i check, if i have really a.ex. the actual ws.jar-file or other related files of the patch?
    We are using the standalone ITS with an own (modified) IAC with an own CI-design for the webpages. The intermediate screens are displayed with the "normal" SAPGUI-design because of the parameter ~generatedynpro. Without this it does not work, because the template SAPLSIT_0100 is missing!
    Or do you have an example for such a intermediate template with the applet for an upload of a file?
    Thanks in advance
    Felix

  • Problem with FIle DownLoad

    Hi All,
    I am working on project where I need to display all the files (on the UI screen)which are in  windows folder with a download link.
    I used IWDDownload UI element for  downloading the file. Its working fine but problem is , when ever I download a file for first time its working fine. Later what ever I download other files, I was able to see only first file download. I guess this is problem with context binding but I am not sure.
    I used for loop to iterate all the files in folder and I binded the file name to IWD Download UI element using bindText option.I am creating UI elements dynamically in wdDoModifyView and it will call another method to bind to context.(As SAP Suggested not to modify any context elements in wdDoModifyView method).
    Please help me in this regard.
    Ramesh

    Ramesh,
    You need N dynamic binary attributes or IWDResource (in newer versions), one per file. Create them either in wdDoInit of view or in some suitable action handler.
    Then you have to populate IWDResource or set bytes of binary attributes. Check corresponding WD tutorials how to do this.
    In wdDoModifyView create IWDFileDownload control per every attribute and bind either "data" property (to binary attribute) or "resource".
    Valery Silaev

  • Problem with file downloads - please help

    Good morning. Since upgrading to BT Infinity 2, I have been experiencing the following problems:
    Cannot update Sonos firmware to version 5 - download times out and gives error 30
    Cannot download most files from safari - all start for the first few kb and then just hang
    Cannot download larger PDF files from Mac Mail
    These problems manifest themselves over wireless and wired connections, with the BT Homehub 5 and an Asus router. My ipad has no problems when on other networks or if I access my email from my work computer. When talking to BT technical support over the chat facility yesterday the connection dropped once every 10-30 seconds before reconnecting again. All of this leads me to believe that I have an intermittent failure on my broadband connection however BT insist that there is nothing wrong with the line or the router. I have changed channels on my router but this does not seem to make things better. Internet is working fine on all my devices for web browsing - only file downloads experiencing problems.
    Please help.

    Oh sorry, I thought from your description you were using an ASUS connected to the HH5, but it turns out you're using them separately.
    Is there a firmware update you can get on the ASUS?
    If you found this post helpful, please click on the star on the left
    If not, I'll try again

Maybe you are looking for