Download Dialog Box appears twice

Hi,
I've a javascript page that make a pdf document in the fly and download that document.
Everything is fine, but when the File Download window appears,
if I press the OPEN button another File Download window opens with the same question.
Then after I select to OPEN the file twice the .PDF is displayed.
So the first window is unnecessary and undesired!
How can I remove this first File Download window??
If I select the SAVE button at the first time, it works.
I've already theses lines:
String stringFile = (string with the decoded file)
arquivoPDF = new StringBuffer( stringFile );
byte[] buffer = Base64.decode( arquivoPDF.toString() );
out.clear();
response.setContentType("application/pdf");
response.setHeader("Transfer-Encoding","base64");
response.setHeader("Content-Disposition", "attachment; filename=\"" + "teste.pdf" + "\"");
response.setContentLength(buffer.length);
response.getOutputStream().write(buffer, 0, buffer.length);
I did some research, but didn't find a resolution.
Thanks for any help,
maklima

The form should arrive at the server once, the previous reuqest is discarded....
But we are not talking forms or javascript here.
A simple setup:
My hyperlink:
<a href="<%=request.getContextPath()%>/querydownload">Download</a>
In web.xml:
<servlet-mapping>
<servlet-name>DownloadCSV</servlet-name>
<url-pattern>/querydownload</url-pattern>
</servlet-mapping>
Servlet:
<snip>
response.addHeader("Content-Disposition", "attachment;filename=blah.csv"));
response.setContentType("text/comma-separated-values");
OutputStreamWriter oStream = new OutputStreamWriter(response.getOutputStream());</snip>
then write() to oStream, flush() and close()
That will popup the download-box twice....

Similar Messages

  • Using Message Built-In - Message dialog box appears twice

    Hi all,
    I'm using the message built-in to display messages in forms.
    I use the message command twice to make it appear as a dialog box.(Using it once displays it in status bar)
    Eg.
    Message('Hello World');
    Message('Hello World');
    Sometimes, the dialog box appears twice instead of once.
    Is there a way to solve this ?
    Regards,
    Sam

    With an alert, you can write up to 200 characters in the alert box. With a message, you can write up to 255 characters, and if you want the message to pop up in an alert box, you can write a double message. I use:
    Message('Hello World');
    Message(' ',no_acknowledge);

  • No download dialog box appears

    Hello,
         When I try to download/install Flash Player, the page says "preparing installation", but the download dialog box never appears before "preparing installation" disappears.  I somehow did a complicated work around by following directions on this website to get Flash Player installed.  Since then, everytime I started/restarted my computer, Adobe would say that a new version of Flash Player was available.  But the "new version" was the CURRENT version!
         I have now uninstalled Flash Player and would like to download/install it using the normal method.  Could someone please help me with this?
         Thanks in advance for any help offered.
         Der Grashüpfer

    Hello Pat,
         I apologize for the delay in responding, but I did not recieve an email notification of your reply.
         I use IE8 on Windows Vista Home Premium.
         Since my last post, I have installed Flash using the work around, and have not had the problem of being prompted to download/install a version which I already have.
         It would be nice to know, though, why the download won't work from the normal download page.
         Sincerely,
         Der Grashüpfer

  • I am using an iphone 3g and when i connect my device to my laptop a dialog box appears saying that an update of 4.2 is available so went for it.after the firmware is downloaded via itunes it shows that the firmware is invalid!.please help.

    HEY GUYS I AM USING AN IPHONE  3g and when i connect my device to my laptop a dialog box appears saying that an update of 4.2 is available so went for it.after the firmware is downloaded via itunes it shows that the firmware is invalid!.please help.
    AND ALSO I HAVE HEARD THAT THE IPHONE 3G CANNOT BE UPDATED TO IOS 4.2!IS IT TRUE???
    PLEASE HELP ME.

    This means that the phone you have was software unlocked to use on any carrier, or hacked. When you installed the update it restored the lock that originaly came with your phone. Not much you can do now. Apple will not support hacked phones. You will need to find out the carrier your phone is locked to and see if they offer official unlocking, or start googling to see if you can find a way to unlock 4.2.

  • I want to download and install adobe flash player. When I do so one occur. A dialog box appears but it has no run option but a save file or cancel option.

    # Question
    I want to download and install adobe flash player. When I do so one of 2 things occur. A dialog box appears but it has no run option but a save file or cancel option. The other is if the proper dialog box appears, I agree and the a different box appears and there is foxfire with a red circle with a diagonal line across is appears.

    I find the easiest way to install Adobe Flash is to use the manual installers. You just need to download the installer to your computer, then run it to install Flash. For more details see http://kb2.adobe.com/cps/191/tn_19166.html#main_ManualInstaller
    That link states you should uninstall earlier versions, as you don't have the version of Flash used by Firefox you can skip that step.

  • Export Save / Open dialog box appears behind disco screen

    Hi all
    Disco 10g Plus, excel, latest Sun java 6.16 jvm
    We have an annoying but strange issue with exporting.
    A user opens and runs a report ok.
    Withing Disco 10 plus they then click on either file-Export-excel or click on the Export Excel icon on disco plus toolbar
    Either way the export happens and a dialog box appears with blue progress bar and then this disappears.
    And then nothing appears to happen.
    However, something actually has happened, behind the disco 10 window the 'File Download' dialog box with 'Do you wish to open or save this file?' appears. Clicking on save saves it to PC and clicking open opens it in Excel which is fine.
    I am not sure of this box belongs to excel or internet explorer but does anyone know of any way to have this dialog box appear IN FRONT of the current disco plus window as some of our users think that disco has 'frozen' and thus log support calls.
    thanks in advance,
    dw
    Edited by: derrywriter on Sep 30, 2009 2:40 PM

    Hi dw
    I have heard of folks complaining that exports to Excel hang. I have not had any feedback to say that the dialog box is actually open behind the scenes. This is very interesting news and thanks for reporting it. I will certainly look for this in the future and see if I can find a pattern.
    If I may ask, what exact version of Discoverer are you on and what cumulative patch level have you implemented?
    Also, what browser are you using and have you tried this in another one?
    Have you tried deinstalling Java 6.16 and tested with an older one like 6.11 which I have seen working very well?
    As much extra information as you can provide will definitely help and could trigger an idea from someone reading.
    Best wishes
    Michael

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

  • Modifying the name of the file in the download dialog box

    Hi all!
    I've a javascript page that make a pdf document in the fly and download that document. Everything is fine, but I'd like to know how can I modifying the file name in the download dialog box, i.e., when the page display:
    "You are downloading the file:
    xpto.jsp from ..."
    I want to substitute the "xpto.jsp" by "file.pdf".
    I've already theses lines:
    response.setContentType("Application/pdf");
    response.setHeader("Content-Disposition", "attachment; filename="+ nameFile+";");
    response.setHeader("Content-Length", ""+stp.length);
    but the problem persist.
    Note that in the second window, the Save As window, everything is fine, the nameFile appears in the file name box. The problem it's only in the first window, the File Download window.
    Thanks for any help,
    A. Santos

    I've discover something. When the File Download window it's displayed with the following text:
    "You are downloading the file:
    xpto.jsp from localhost
    Would you like to open the file or save it in your computer?
    button OPEN button SAVE button CANCEL button MORE INFO"
    if I press the OPEN button then another File Download window opens with the rigth text:
    "You are downloading the file:
    file.pdf from..."!!!
    i.e, the text desired!
    So the first window is unnecessary and undesired!
    How can I remove this first File Download window??
    Please help!
    A. Santos

  • 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

  • No dialog box appears

    I am using DW8 with Coldfusion trying to add a new recordset
    in the bindings tab. After selecting the + sign in bindings I am
    confronted with a dropdown list with the first option being
    "recordset(query)". When I select that option NO dialog box
    appears. When I first installed DW8 it worked, but not anymore. Has
    anyone dealt with this issue?
    (WindowsXP SP2)

    Hello Pat,
         I apologize for the delay in responding, but I did not recieve an email notification of your reply.
         I use IE8 on Windows Vista Home Premium.
         Since my last post, I have installed Flash using the work around, and have not had the problem of being prompted to download/install a version which I already have.
         It would be nice to know, though, why the download won't work from the normal download page.
         Sincerely,
         Der Grashüpfer

  • Confirmation Dialog Box Appears Disappears

    Hi,
    I am facing a problem here on Same os win 98 using different versions of Java run time environment.
    The code is supposed to work in this way.
    Applet is initiated by a click. a confirmation dialog box appears askign for input from a user in the form of a Yes or a No. if the user clicks Yes the applet continues otherwise it terminates.
    while using 1.4.1_02 This problem occurs that the Confirmation dialog box appears and then disappears for the jar is being downloaded.
    But using 1.3.1_04 gives no problems and the Confirmation box does not disappear.
    Regards,
    Saurabh

    Hmmm, are you running 10.6.8 or later & installed the Security updates?
    Java was an attack vector for FlashBack.
    Disable Java in your Browser settings, not JavaScript.
    http://support.apple.com/kb/HT5241?viewlocale=en_US
    http://support.google.com/chrome/bin/answer.py?hl=en-GB&answer=142064
    http://support.mozilla.org/en-US/kb/How%20to%20turn%20off%20Java%20applets
    Flashback - Detect and remove the uprising Mac OS X Trojan...
    http://www.mac-and-i.net/2012/04/flashback-detect-and-remove-uprising.html
    In order to avoid detection, the installer will first look for the presence of some antivirus tools and other utilities that might be present on a power user's system, which according to F-Secure include the following:
    /Library/Little Snitch
    /Developer/Applications/Xcode.app/Contents/MacOS/Xcode
    /Applications/VirusBarrier X6.app
    /Applications/iAntiVirus/iAntiVirus.app
    /Applications/avast!.app
    /Applications/ClamXav.app
    /Applications/HTTPScoop.app
    /Applications/Packet Peeper.app
    If these tools are found, then the malware deletes itself in an attempt to prevent detection by those who have the means and capability to do so. Many malware programs use this behavior, as was seen in others such as the Tsunami malware bot.
    http://reviews.cnet.com/8301-13727_7-57410096-263/how-to-remove-the-flashback-ma lware-from-os-x/
    http://x704.net/bbs/viewtopic.php?f=8&t=5844&p=70660#p70660
    The most current flashback removal instructions are F-Secure's Trojan-Downloader:OSX/Flashback.K.
    https://www.securelist.com/en/blog/208193454/Flashfake_Removal_Tool_and_online_c hecking_site
    More bad news...
    https://www.securelist.com/en/blog/208193467/SabPub_Mac_OS_X_Backdoor_Java_Explo its_Targeted_Attacks_and_Possible_APT_link

  • When I attempt to send a text from the new iPad, a dialog box appears with the option to either sign in with Apple ID Password or Create New Account. I try signing in using my Apple ID password but IMessage informs me that email address cannot be verified

    When I attempt to send a text from the new iPad, a dialog box appears with the option to either sign in with Apple ID Password or Create New Account. I try signing in using my Apple ID password but IMessage informs me that email address cannot be verified because it is already in use ??? What am I doing wrong?

    settings -> iTunes & App Store
    click on apple ID listed there
    select Sign Out
    sign in with the proper account
    from then on, when the store ask for your password it should be with the correct ID

  • How can I forward next page, and then pop-up a download dialog box.

    My require is that pop-up a download dialog box after forwarding next page.
    I have read the coding in the processFormRequest of current page like below,
    but I find out that it only can pop-up a download dialog box,
    however, it can't forward the next page.
    pageContext.setForwardURL("OA.jsp?page=/oracle/apps/xxfm/fm002/webui/TEST001PG",
    null,
    OAWebBeanConstants.KEEP_NO_DISPLAY_MENU_CONTEXT,
    null,
    null,
    true,
    OAWebBeanConstants.ADD_BREAD_CRUMB_NO,
    OAException.INFORMATION);
    //set default file name: [YYYYMMDDhhmm_IN.EXCEL,FILE_NAME.csv]
    StringBuffer strFileName
    = new StringBuffer().append((pageContext.getCurrentDBDate().toString().substring(0, 16))
    .replaceAll("-","").replaceAll(" ","").replaceAll(":",""))
    .append("_IN.").append(strExcelFileName).append(".csv");
    //give csv file content
    BlobDomain csvFileBlob = (BlobDomain)am.invokeMethod("createCsvFile");
    //setenv
    HttpServletResponse response
    = (HttpServletResponse)pageContext.getRenderingContext().getServletResponse();
    response.setContentType("application/octet-stream");
    response.setHeader("Content-Disposition", "attachment; filename="+strFileName.toString());
    System.out.println("fileName : "+strFileName.toString());
    //download
    InputStream fileIn = csvFileBlob.getBinaryStream();
    long fileLen = csvFileBlob.getBufferSize();
    int readBytes = 0;
    int totalRead = 0;
    byte blockgbyte[] = new byte[65000];
    response.setContentType("application/x-msdownload");
    response.setContentLength((int)fileLen);
    while((long)totalRead < fileLen)
    readBytes = fileIn.read(blockgbyte, 0, 65000);
    totalRead += readBytes;
    response.getOutputStream().write(blockgbyte, 0, readBytes);
    fileIn.close();
    response.getOutputStream().flush();
    I don't know what's matter in the app, can you tell me how to deal with it.
    Thanks in advance.

    Hi there,
    I have a similar requirement. User will download search results in a CSV file after which I want either the page to be refreshed or to be able to goto a Confirmation page or navigate to another page.
    I tried using setForwardURL / forwardImmediately / redirectImmediately methods as well as redirectToDialogPage. Since we use pageContext.setDocumentRendered(false); and response.getOutputStream().flush(); methods, the HttpResponse is already committed.
    Hence, the page does not redirect to another page as Request is processed and Response is complete. In case of methods like setForwardURL A JSP forward redirects the same request object to the target URL.
    Can anyone help here to achieve the expected requirement?
    Thanks.

  • 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

  • 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

Maybe you are looking for

  • How to hide cells in the sumation row in bps web layouts

    Hello xperts, I'm looking for a possibility to hide certain cells in the sumation row within a planing table (layout) over the webinterface builder. can anybody help me. I know there is a possibility to influence a table with the tableinterface for r

  • Outbound mail using ERMS

    Hi, I need some inputs on configuring a outbound mail based on rule modeler & category schema using same ERMS functionality but without any incoming mails. Can anyone suggest any relevant tables for triggering outbound mails for a business object in

  • How to use oc4j_extended in JDeveloper9i

    I download oc4j_extended.zip, I want plug it into JDeveloper9i, How should I do? Thanks Zhiying

  • 802.11n enabler doesn't install on C2D

    I've just purchased the 802.11 enabler and doesn't install in a MacBook core 2 duo 15'4" well, it's a core 2 duo, it's intel chipset, and it's one of the suitable machines typ for this update, as read in Apple store specs so, What's the matter? The f

  • I have never been more furious in my life.

    On September 20th, I ordered a silver 16gb iPhone 5S. Nearly a month later, Apple sent me an e-mail telling me an outstanding payment on my Verizon bill was preventing the iPhone from being shipped. I paid the bill, and waited. They delayed the shipm