How to Display save as dialog box.

Hai all,
am having a jsp page in which i display some values in Table. if i click a button it should show a save as dialog box, from that i should give a file name then all the content must be save in that file name. Any one give idea to open save as dialogbox from button click.
Thanks.

You can t do what you want.
But you can do something similar..
In stead of save as do a submit to a servlet and have you servlet download the file to the client
download by setting your contenttype to
response.setHeader("Content-Disposition", "attachment; name=\""+filename+"\"; filename=\""+filename+"\";");

Similar Messages

  • In javascript how to invoke save as dialog box ,which saves .pdf files only

    Through javascript i generated a save as dialog box. the main problem is , it is only saving .html and .doc files by default. how to restrict it to save only .pdf files.
    the code i used is
    function SaveFile(fname)
    document.execCommand('SaveAs', null, fname)
    <input type="button" value ="save" onclick="SaveFile('');">
    /**********************************************************************/

    this is actually a Java forum its slightly different from javascript
    but try this not sure if it helps
    <input type="button" value ="save" onclick="SaveFile('.pdf');">

  • How come the "save as" dialog box keeps popping up whenever I try to use alt codes?

    I type with diacritical marks regularly but recently, when I press and hold Fn + Alt + the numerical code, it brings up the "save as" dialog box. This seems to be a Firefox-specific issue because this doesn't happen on Microsoft Word + other programs. I am wondering how to disable this "save as" dialog box shortcut, or how to just get the alt codes to work.

    Hm, this is the list of add-ons that are currently enabled on my browser:
    <br><br>
    Dictionnaire française moderne (it can't be this one because I just installed it today)<br>
    Java Console 6.0.18<br>
    Java Console 6.0.25<br>
    Java Console 6.0.20<br>
    Java Console 6.0.24<br>
    pdfit (doesn't seem like it's this one either)<br><br>
    Conclusion: might it be one of the Java Consoles?
    Thanks!

  • How to use save as dialog box in swing

    hello,
    at the time of start the application by clicking the button, i hv to give the path to save my output file, how can i used this dialog box
    thanks

    [http://java.sun.com/docs/books/tutorial/uiswing/components/filechooser.html]

  • How to get save as dialog box.

    i want to open a "save as" dialog box from file menu.and i want to specify by myself which type of item should be in "Save as type" drop box in the save as dialog box.how to do it???????plz help........thanx in adv.

    I believe that the Sun tutorial over [How To Use File Choosers|http://java.sun.com/docs/books/tutorial/uiswing/components/filechooser.html] will be able to give you the answer for this one. This and the JFileChooser API and other associated APIs.

  • How to give save as dialog box using servlet?

    hello,
    i am building one application where i am generatinfreport in excel format.
    now the file generated is output.xsl.
    this is in c:\bea\wlserver6.1 directory.
    now i want to write a servelt get this file from location given above and give user Save As dialog box.
    can anybody provice me sample code from this....
    thank you.

    Hi,
    Hope the following code snippet helps, Put this in your doGet/doPost method.
    FileInputStream fileInputStream = null;
    ServletOutputStream out = response.getOutputStream();
    String srcfile = "c:\bea\wlserver6.1\myxsl.xsl";
    String destfile = "myxsl.xsl";
    response.setContentType("text/xml");
    response.setHeader("Content-Disposition","attachment; destfile=\""+ filename + "\"");
    try {
         fileInputStream =new FileInputStream(srcfile);
         int i;
         while ((i=fileInputStream.read()) != -1) {
              out.write(i);
    }catch (Exception e){
         System.err.println (e);
    }finally{     
         fileInputStream.close();
         out.close();     
    Good Luck,
    Rajesh

  • How to force SAVE/OPEN dialog box to appear in IE? (save output locally)

    Hi all!
    I currently have various reports in Excel format outputted in cache via the iAS browser.
    Is there a way to programatically force a SAVE/OPEN BOX to appear in IE whenever my output is spreadsheet/excel? The prompt box appears on Firefox and Opera but not in IE, i take it that IE has already been 'configured' to open excel spreadsheet automatically in the browser.
    Another spin to the question is: How do end users save the Reports output directly to their local machine; instead of having it opened in the browser or saving it in the midtier server

    I found a backdoor solution to this:
    at the URL link, i added &mimetype=application, this will force IE to show the save dialog box because it does not know what the application type is.

  • How to display a message dialog box

    I need to know how to display a message box from my application.
    Anyone can help me?
    Thanks in advance

    Dear Zennen,
    Use JOptionPane.
    Ex
    JOptionPane.showMessageDialog(this,"message","title",JOptionPane.INFORMATION_MESSAGE); Thanks
    Joey

  • Infopath submit - how to hide - Save as dialog box - You can only save this file to the current site

    HI,
    I have a infopath form. In the submit options, i have used the below:
    submit options -
    sharepoint document library
    Data connection - Sharepoint Library Submit
    Doc library - lib location
    File name: concat("User Info - ", ResourceName, "-", PersonalID)
    Allow overwrite if file exists is checked.
    When I try to save a record, I am getting a popup:
    Save As:
    You can only save this file to the current site
    File Name: textbox
    save location: doc lib.
    save, cancel buttons.
    How to override this save as option(save as option should not be shown to user), and save the file using the file name mentioned?
    Thanks

    Are you clicking "Save" when you're using the form or "Submit"??
    You should be using "Submit" and it will ... submit your form to the document library with the file name you specified.
    To disable the "Save" button, click on "File" then "Form Options". Under the "Filler Features" area you can uncheck the box beside "Save and Save As". Click OK then re-publish your form.

  • How to display non modal dialog box in a Dll call from TestStand implemented in visual c

    Dear Jason F.
    Applications Engineer
    National Instruments
    Hello
    I did the same way you told me
    the non modal dialog appeared and
    system hangs and
    giving the error message
    ""SeqEdit.exe-Application Error
    The instruction at �0x047fc5b0� referenced memory at �0x047fc5b0�. The memory could not be �read� ""
    please solve my problem
    and thanks for yours early response
    you can email me at
    [email protected]

    Hi Mkehret,
    Does your dialog have ActiveX controls on it? If your DLL dialog uses ActiveX controls and is not programmed in a certain manner it can hang because of a conflict in the threading model used by the TestStand Engine that is calling into your DLL and the model that is required by the MFC ActiveX Container. If you are using ActiveX controls in your dialog, you need to make special considerations for the threading model MFC dialogs that use ActiveX controls need in order to work properly. The example under \Examples\MFCActiveXContainerDlg illustrates how to appropriately handle this situation as well as explaining why it is necessary.
    Note: The above example displays the dialog as modal, but this is irrelevant to the problem I am describing.
    Again for information on properly creating a dialog class object and displaying it as non-modal refer to the information on MSDN that I referred you to in this post:
    http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RPAGEID=135&HOID=506500000008000000E98A0000&USEARCHCONTEXT_CATEGORY_0=_8_&USEARCHCONTEXT_CATEGORY_S=0&UCATEGORY_0=_8_&UCATEGORY_S=0
    If your dialog does not use ActiveX controls or after trying the programming method illustrated in the "MFCActiveXContainerDlg" example TestStand still hangs when calling your DLL, try calling your DLL from another environment just to make sure whether the DLL works at all. If the DLL works properly when called by another environment (e.g. VB, VC++, LabVIEW, or CVI), please submit a MINIMAL and REPRODUCEABLE example source project for your DLL for us to look at (please exclude all unnecessary code not required to reproduce the specific problem of displaying the dialog, and include all files necessary to build your dll with any
    specific instructions needed to do so).
    Jason F.
    Applications Engineer
    National Instruments
    www.ni.com/ask

  • How do you customise the finder "save as" dialog box?

    Hi
    I get a lot of email with attachments that I need to work on - word documents and powerpoint slides mainly.
    I am still running Snow Leopard and I think Finder is very frustrating. Has it been improved in this aspect in Mountain Lion?
    Firstly, if I look at the email and click the "save" box next to the attachment, it immediately puts the attachment in the download folder. I dont want that. I want to be given a dialog box giving me options where to save the file in my heirachy of folders that I have set up by client and project. Sending it to the download folder is a naff default, but I cannot find a way to change this default?
    Secondly, if i scroll down to the bottom of the email to see the attached file, and then right click to "save as", I get a dialog that is devoid of all the customisation options I have chosen for the standard finder view. For examply, I cannot get the "path" to be displayed as part of the "save as" dialog box.
    This is all pretty fundamental stuff, and Windows have been able to offer much better customisation and default setting in Windows Explorer for years. WHy is OSX so far behind in this aspect?
    Is Lion better?
    Do I have to fork out an additional $35 for each of my 3 macs to buy "Default Folder" just to get something that should be basic workflow management within the OSX  
    Am I missing something?

    Thanks Jeffry
    Yes I am using the expanded save dialog.
    Thanks for pointing out how to change the default save location away from the downloads folder.
    What I really want, though, is for when I press the "save" button next to an attachment in the email, then I want to be given the choice of where to save it, and easy ways of navigating to my recent folders, favourite folders etc. Each file I save will need to go to a folder dependent upon which client it is, so just saving then all by default into "Documents" for example, means that after saving them, I then need to go and move them to the correct location.
    How to I get to have a choice if where to save whenever I press the SAVE button 

  • How do I call browser Save As dialog box before downloading pdf files?

    How do I call browser Save As dialog box before downloading pdf files?
    Here's my favorite scenario:
    1. User clicks button
    2. Save As dialog displays
    3. User chooses location
    4. A set of PDF files download to that location OR a single zip file downloads
    Background:
    I want to ensure the user sees that files are being downloaded. I'm delivering content to users who may not be Web savvy.
    Concern:
    1. User has no clue how to find downloaded files or that files have even downloaded.
    2. I'd like to deliver the set as zip files. Not sure if self-opening zip files still exist.
    FYI:
    I'm using jQuery UI buttons. Not sure if that factors into response.

    Just for clarity, I'm not forcing a download. The user will click a button.
    Click a button or click a link, either way you're technically executing a script to force a download.
    I'm assuming that's the php file resident on the server.
    Yes but that's only part of it.  Once the contact form executes, another script is called up which opens the browser's download dialogue.
    Is there a php script for simply calling the Open/Save dialog box?
    Yes. 
    <?php
    /* This short script forces a file download.
       For simplicity, it's intended to be used for a single file.
       You can use multiple copies of this file (with unique names)
       with different variable values to use it with multiple files.
       Use of this script has a side-effect of hiding the location of the
       file on your server.
    // full server path to file to be downloaded (including filename)
    $Path2File = "path/to-file-on-server.zip";
    // the filename
    $theFileName = "name-of-file.zip";
    //the work gets done here
    header ("Cache-Control: must-revalidate, post-check=0, pre-check=0");
    header ("Content-Type: application/octet-stream");
    header ("Content-Length: " . filesize($Path2File));
    header ("Content-Disposition: attachment; filename=$theFileName");
    readfile($Path2File);
    ?>
    Name this file zip2download.php.
    Add a link to your HTML page:
    <a href="zip2download.php">Download Zip</a>
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists 
    http://alt-web.com/
    http://twitter.com/altweb
    http://alt-web.blogspot.com/

  • How can I get the "Open" and "Save As" dialog boxes to open at larger than their default size?

    How can I get the "Open" and "Save As" dialog boxes to open at larger than their default size?  I would like them to open at the size they were previously resized like they used to in previous operating systems.  They currently open at a very small size and the first colum is only a few letters wide necessitating a resize practically every time one wants to use it.  Any help would be appreciated.

    hi Prasanth,
    select werks matnr from ZVSCHDRUN into table it_plant.
    sort it_plant by matnr werks.
    select
            vbeln
            posnr
            matnr
            werks
            erdat
            kbmeng
            vrkme
            from vbap
            into table it_vbap
            for all entries in it_plant
            where matnr = it_plant-matnr and
                  werks = it_plant-werks.
    and again i have to write one more select query for vbup.
    am i right?

  • How to open a save file dialog box in form

    hi
    all
    I have prob in form desing , i have open the save file dialog box , how to open a save dialog box
    and path of the select file to save in disk
    help
    thx

    hi
    user this query when-button-pressed trigger
    :txtfile := GET_FILE_NAME(directory_name =>'d:\ali_raza\backup\', file_filter=> 'DMP Files (*.dmp)|*.dmp|');
    Rizwan

  • How to open a 'Save As' Dialog box in JSP?

    Hi all, i need to export a CSV file. A button is provided to the user to choose the directory to save the file. My problem is how to open a 'Save As' dialog box in JSP?
    Thanks in advance

    Hi,
    Below is my full code to download fiel but still the Save Dialog box still not show..
    <%@ taglib prefix="cs" uri="futuretense_cs/ftcs1_0.tld"
    %><%@ taglib prefix="asset" uri="futuretense_cs/asset.tld"
    %><%@ taglib prefix="assetset" uri="futuretense_cs/assetset.tld"
    %><%@ taglib prefix="commercecontext" uri="futuretense_cs/commercecontext.tld"
    %><%@ taglib prefix="ics" uri="futuretense_cs/ics.tld"
    %><%@ taglib prefix="listobject" uri="futuretense_cs/listobject.tld"
    %><%@ taglib prefix="render" uri="futuretense_cs/render.tld"
    %><%@ taglib prefix="siteplan" uri="futuretense_cs/siteplan.tld"
    %><%@ taglib prefix="searchstate" uri="futuretense_cs/searchstate.tld"
    %><%@ taglib prefix="locale" uri="futuretense_cs/locale1.tld"
    %><%@ taglib prefix="dateformat" uri="futuretense_cs/dateformat.tld"
    %><%@ taglib prefix="blobservice" uri="futuretense_cs/blobservice.tld"
    %><%@ taglib prefix="satellite" uri="futuretense_cs/satellite.tld"     
    %><%@ taglib prefix="date" uri="futuretense_cs/date.tld"
    %><%@ page import="COM.FutureTense.Interfaces.*,
    COM.FutureTense.Util.ftMessage,
    COM.FutureTense.Util.ftErrors"
    %><%@ page import="COM.FutureTense.Interfaces.*,
    COM.FutureTense.Util.ftMessage,
    COM.FutureTense.Util.ftErrors"
    %>
    <%@ page language="java" contentType="text/html;charset=UTF-8" %>
    <%@ page import="java.io.File" %>
    <%@ page import="java.io.OutputStream" %>
    <%@ page import="java.io.FileInputStream" %>
    <cs:ftcs><%-- france/test_template
    INPUT
    OUTPUT
    --%>
    <%-- Record dependencies for the Template --%>
    <ics:if condition='<%=ics.GetVar("tid")!=null%>'><ics:then><render:logdep cid='<%=ics.GetVar("tid")%>' c="Template"/></ics:then></ics:if>
    <%
    String fileToFind = request.getParameter("file");
    if(fileToFind == null) return;
    File fname = new File(fileToFind);
    System.out.println("Save As: "+fname.getName() );
    if(!fname.exists()) return;
    FileInputStream istr = null;
    response.setContentType("application/octet-stream;charset=ISO-8859-1");
    response.setHeader("Content-Disposition", "attachment; filename=\"" + fname.getName() + "\";");
    try {
    istr = new FileInputStream(fname);
    int curByte=-1;
    while( (curByte=istr.read()) !=-1){
    out.write(curByte);
    out.flush();
    } catch(Exception ex){
    ex.printStackTrace(System.out);
    } finally{
    try {
    if(istr!=null) istr.close();
    } catch(Exception ex){
    System.out.println("Major Error Releasing Streams: "+ex.toString());
    try {
    response.flushBuffer();
    } catch(Exception ex){
    System.out.println("Error flushing the Response: "+ex.toString());
    %>
    </cs:ftcs>
    Can anybody help me with this???
    Thank you in advance.

Maybe you are looking for

  • Ho do I use one monitor for OSX and Windows 8.1 bootcamp

    I am a long time Mac user, but find the fairly recent Apple switch to thunderbolt for monitor input very frustrating. For several years I have ran a Mid 2010 IMac 27" and input video from a Mac Mini running Boot Camp Windows 7 using Target Display Mo

  • Dual boot Windows 7 (64) and Arch Linux (64) problems

    Hello: I am new to Arch Linux and just finished installing the 64bit on my laptop. It had a prebuilt Windows 7 (64) installed which I kept but split the hdd from 160Gb to 80Gb and 80Gb. I installed Arch there and set 4 partitions, all of them as Logi

  • Really need some !!HELP!! ALMOST 6 MONTHS WITH OUT BURNING A CD

    I've posted before about my problem but but i still have not gotten an answer. This might be my last atempt to get any help before i end up taking my laptop to a repair shop so here we go. I've recently ran a diagnostic with i tunes and here it is: M

  • Education Report Not Working in MSS

    Hello experts, I am having an issue with one mss report for Education and training. The rest of the reports are working fine. Also when I go to LPD_Cust and click on MSS ITS_NAV1 I get a message reading "Please run report ABP_LPD_CORRECT_TEXTABLES in

  • How to reduce page faults (virtual memory) usage in LabVIEW

    I am running LabVIEW 2010 on Windows Embedded Standard system 4G (3G usable) of RAM. The program (executable running on the Run-Time Engine) continuously samples from a USB-6251 at 1MS/sec (2 channels @ 500K) and scans the data stream for anomalous e