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

Similar Messages

  • 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

  • After running csv report, open the 'File Download Dialog'

    Hello,
    I would like that, if I run a report, then I liked directly File Download Dialogue gotten.
    How can i make this?
    Thank you!

    can you give more details on how you call the report.
    if you use url method to call , it will open the excel after the report is generated
    when appropriate desformat is given

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

  • 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

  • How to open the file in gmail

    How to open the file in gmail. As is keep indicate is not support. Previously I can easily open the excel or words sheets that send to my email but After download the Free Trial for Adobe Pro( Convert PDF file to Microsoft words. )

    More information would be helpful, such as the file format and what the error message is in more detail.

  • HT4796 I have made a file using the Pages app.I mailed it to a friend.When she tried opening the same file on her pc at home , It did not open.Please help me as to how to open the file in the Microsoft word format on her pc.

    I have made a file using the Pages app.I mailed it to a friend.When she tried opening the same file on her pc at home , It did not open.Please help me as to how to open the file in the Microsoft word format on her pc.

    Send it as a PDF.

  • How to open the file types of iOSApp(ipa),EPUBFile(.epub) in windows 7(32 bit)

    How to open the file types of iOSAPP(ipa),EPUBfile(.epub) in windows 7(32 bit)

    iOS apps can be added to an iTunes library and thereafter transferred to an iOS device. They cannot be opened directly on a PC.
    epub files can be added to an iTunes library, and thereafter transferred to an iOS device where they can be read with the iBooks application. Files protected with Apple's DRM cannot be opened directly on a PC, though there are programs such as Kindle and Calibre that will open non-protected epub files.
    tt2

  • How to open the choose application dialog on Mac?

    Hi all,
    I want to know how can we open the "choose application" dialog from InDesign. I want to give this functionality through right click context menu.
    At present CS4 has this feature - steps are as follows:
    1.Create a document.
    2.Place an item on the document.
    3.Now select the placed item and right click on it.
    4.Go to "Edit With->Other..." option.
    5.Choose application dialog opens up and user can select the application in which he/she wants to open the selected item.
    I want the same behavior but not able to understand how to open the choose application dialog on Mac. I have already achieved this on windows.
    I think that there might be some system API's for Mac to get this working.
    Please let me know about this, any help will be appreciable.

    Is this not sufficient? Looks like  you get some defaults then an "other" at the bottom as well. Control click or right click, when using the white arrow on the image.

  • How do you Re-Open the Camera Raw Dialog box after closing it?

    Hi All,
    going crazy trying to figure out how to reopen the Camera Raw dialog box after closing it in photoshop. I know I found it once but have since forgetten. Any help would be much appreciated!
    thx!
    Jayson

    When the image is open in ACR hold down the SHIFT key and you'll see the button marked Open Image changes to Open Object, so do your ACR adjustments then hold down shift and click Open Object - your image will open as a Smart Object in Photoshop.
    If using Lightroom you can right click the image and select Edit>Open as Smart Object in Photoshop from the drop-down menu.
    Do not confuse normal smart objects with what we're talking about here, Camera RAW Smart Objects - possibly one of the most powerful tools to have at your dispossal, once you understand them.
    Hope this helps

  • How can I open the "Pane Properties Dialog Box", without right-clicking on the scrollbar of the pane?

    To open the "Pane Properties Dialog Box" the LabVIEW Help suggest following:
    "Right-click in the scrollbar of a pane and select Properties from the shortcut menu to display this dialog box."
    The Problem is that I would like to switch off the scrollbars, which once done, means I can't right-click on the scrollbar anymore !
    There must be a different way to get to this Menu, too ?!

    Typically, you would hide the scrollbars only when running, and in this case there is no problem. I guess you should keep at least one of the scrollbars visible in edit mode.
    Once both scrollbars are hidden, you can restore them using the "VI properties...windows appearance...customize" dialog.
    LabVIEW Champion . Do more with less code and in less time .

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

  • 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

  • How to get a file save dialog box on button click

    Hi All,
    I have  some text  and I want to write this text in to a  file.Then I want to save this file to my local system using a file save dialog box so that I can choose the location where I want to save this file.Please tell me how can I do this in WebDynpro.
    If I cannot get the File save Dialog Box then how can I give the path while creating the new file so that it is created on my local system  as the application is running on server.
    Regards
    Rahul

    Hi Rahul,
    Sometime back I was also facing the same requirment and there are only two solutions to it one is what Armin suggested to use the file download UI element the other one you can get from this link How to write a file on our local machine using Web Dynpro
    Regards
    Sid

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

Maybe you are looking for

  • Adobe Acrobat XI PRO crash in Maverics

    Hello, My Adobe x and XI PRO will not run anymore since i upgraded to MAverics. I did a total removal and re-install of entire Adobe Creative Suite, and Adobe Acrobat. "Configuration error"  "Error 16" Called apple seems to be a issue with Adobe Lice

  • Embedding HTML into a JSFF dynamically

    Hi, I have a requirement where I need to embed an HTML table into a jsff (popup). I have a method which returns me a String (HTML) based on various other dynamic conditions. The returned HTML is a table. Now I need to show this HTML in a popup when u

  • Itunes 45075 error code

    After I installed itunes, I kept getting (-45075) error code and my itunes would shut itself down right after.  I tried a few times of uninstall and reinstall of itunes and kept getting the same error code.  I am hoping to get some solutions regardin

  • Garageband refuses to read midi files

    Impossible to read midi files in Gagareband Could you help me ? When i put it over a track nothing happens.

  • APPCRASH windows 7 (64bit) itunes 10

    Hi there, i have a Iphone 3gs i havent updated the software till now and now i have put the latest phone and Itunes software on my computer and now i cant sync my phone before a window appears showing: Problem signature: Problem Event Name: APPCRASH