92 users online (1 members and 91 guests)  

  Results 1 to 2 of 2


  1. Open Program from HTML Link    Forum: HTML Forum
    Replies: 10
  2. Replies: 3
  3. Replies: 4
  4. Save As Dialog Box    Forum: Website Scripts Forum
    Replies: 3
  1. #1
    randy_o's Avatar
    New User

    Join Date
    Apr 2009

    how to open save/open dialog using HTML

    How can I force the open/save file download dialog box when I click the <a> tag?. There is a zip file available in remote server and also I have a link with that zip file when user clicks that link we want to download that zip file to a local system. But I am trying with normal html file then it will work fine but zip file then that dialog box doesn’t show. This format I have tried with local systems zip file itself it the dialog box is not opening. Can anybody please give me the solution.

    <Script language=JavaScript>

    function openDialog(){

    document.execCommand("SaveAs",true," \\\ELSTest\Projects\QTS\Q0002\pdfviewer_src.zip");


    <Div align=center id=Sect1>
    <Img Src='1.jpg' id=IMG1>
    <p> This is some text</p>
    <a onClick="openDialog()"> link </a>

  2. #2
    jthayne's Avatar

    Join Date
    Aug 2008

    Re: how to open save/open dialog using HTML

    Why are you trying to use javascript to "force" the dialog box to open? I have yet to come across an instance where zip files do not force the dialog box to open by default.

    Have you tried the following?
    HTML Code:
    <div align=center id=Sect1>
    <img Src='1.jpg' id=IMG1>
    <p> This is some text</p>
    <a href="\\\ELSTest\Projects\QTS\Q0002\pdfviewer_src.zip"> pdfviewer_src.zip </a>
    By default all browsers display an "Open/Save As" dialog box when you click on a zip file.

    The problem with the javascript you were using is that the "SaveAs" command saves only the current window meaning you will be saving the current page rather than giving the user the opportunity to download the specified file. This issue is discussed in more detail http://www.faqts.com/knowledge_base/view.phtml/aid/4906
    Last edited by HTML; 03-09-2012 at 10:47 PM.

Tags for this Thread