Downloads Using JavaScripts

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • JCO

    Downloads Using JavaScripts

    Can somebody help me write a JavaScript that will allow a download dialog to
    display then download the selected file (regardless of the file type). That
    way, they won't open a word on the computer they will download it. They
    won't open a picture or an Excel spread sheet... it will all download. I
    don't want to use a zip program because of the many folks that can't seem to
    grasp unzipping files (go figure).
    Thanks


  • Michael Winter

    #2
    Re: Downloads Using JavaScripts

    On Sun, 05 Dec 2004 19:47:02 GMT, JCO <joliviero@hotm ail.com> wrote:
    [color=blue]
    > Can somebody help me write a JavaScript that will allow a download
    > dialog to display [...][/color]

    See the FAQ (<URL:http://jibbering.com/faq/>). Your answer is there.

    So you know in advance, this cannot be done with Javascript.

    [snip]

    Mike

    --
    Michael Winter
    Replace ".invalid" with ".uk" to reply by e-mail.

    Comment

    • JCO

      #3
      Re: Downloads Using JavaScripts

      I was on a site where the link pointed to JavaScript.Down load(xxxxx)
      The xxx are numbers related to a document.
      It seems to be setup so other to download a document.

      Ref: http://eteamz.active.com/texasimage87/

      Thanks


      "Michael Winter" <M.Winter@bluey onder.co.invali d> wrote in message
      news:opsijwrftd x13kvk@atlantis ...[color=blue]
      > On Sun, 05 Dec 2004 19:47:02 GMT, JCO <joliviero@hotm ail.com> wrote:
      >[color=green]
      > > Can somebody help me write a JavaScript that will allow a download
      > > dialog to display [...][/color]
      >
      > See the FAQ (<URL:http://jibbering.com/faq/>). Your answer is there.
      >
      > So you know in advance, this cannot be done with Javascript.
      >
      > [snip]
      >
      > Mike
      >
      > --
      > Michael Winter
      > Replace ".invalid" with ".uk" to reply by e-mail.[/color]


      Comment

      • Michael Winter

        #4
        Re: Downloads Using JavaScripts

        On Sun, 05 Dec 2004 20:04:57 GMT, JCO <joliviero@hotm ail.com> wrote:
        [color=blue]
        > I was on a site where the link pointed to JavaScript.Down load(xxxxx)[/color]

        Assuming you're referring to DownloadFile, that's a function written by
        the author to open a window. Nothing more.

        [snip]

        Mike


        Please do not top-post. See
        <URL:http://www.jibbering.c om/faq/faq_notes/pots1.html>.

        --
        Michael Winter
        Replace ".invalid" with ".uk" to reply by e-mail.

        Comment

        • JCO

          #5
          Re: Downloads Using JavaScripts

          So.... isn't it a JavaScript that makes the download functional?

          "Michael Winter" <M.Winter@bluey onder.co.invali d> wrote in message
          news:opsijyw1r2 x13kvk@atlantis ...[color=blue]
          > On Sun, 05 Dec 2004 20:04:57 GMT, JCO <joliviero@hotm ail.com> wrote:
          >[color=green]
          > > I was on a site where the link pointed to JavaScript.Down load(xxxxx)[/color]
          >
          > Assuming you're referring to DownloadFile, that's a function written by
          > the author to open a window. Nothing more.
          >
          > [snip]
          >
          > Mike
          >
          >
          > Please do not top-post. See
          > <URL:http://www.jibbering.c om/faq/faq_notes/pots1.html>.
          >
          > --
          > Michael Winter
          > Replace ".invalid" with ".uk" to reply by e-mail.[/color]


          Comment

          • Ivo

            #6
            Re: Downloads Using JavaScripts

            " JCO" topposted[color=blue]
            >
            > "Michael Winter" wrote[color=green]
            > > JCO wrote:
            > >[color=darkred]
            > > > I was on a site where the link pointed to JavaScript.Down load(xxxxx)[/color]
            > >
            > > Assuming you're referring to DownloadFile, that's a function written by
            > > the author to open a window. Nothing more.
            > >
            > > Please do not top-post. See
            > > <URL:http://www.jibbering.c om/faq/faq_notes/pots1.html>.[/color]
            >
            > So.... isn't it a JavaScript that makes the download functional?[/color]

            This is in their .js file:

            function DownloadFile(fi le_id)
            {
            PopDownload=win dow.open("/admin/sitez/download.cfm?id ="+file_id+"&si te=<cfou
            tput>#site#</cfoutput>","Dow nloadWindow","s crollbars,width =400,height=300 ");
            PopDownload.foc us();
            }

            All this function does is open a window with a new page. A pretty
            straightforward call to window.open(). I didn't click a link so I don't know
            what happens, but if what you 're seeing is a download dialog, then they
            have the correct headers for that behaviour set by some (serverside) script
            in their file /admin/sitez/download.cfm. Once again: there is no javascript
            involved.

            And once again, please don't top-post. In other words: please bottom-post.
            This may seem unnatural at first, thousands of us have gone through that,
            but eventually you 'll see that it helps the discussion and exchange of
            ideas. Please do read the link that Michael provided, especially
            <URL: http://www.jibbering.com/faq/faq_not....html#ps1TopPs >
            ..

            HTH
            --
            Ivo



            Comment

            • JCO

              #7
              Re: Downloads Using JavaScripts

              I understand now. Thanks

              "Ivo" <no@thank.you > wrote in message
              news:41b38a17$0 $81374$1b2cd167 @news.wanadoo.n l...[color=blue]
              > " JCO" topposted[color=green]
              > >
              > > "Michael Winter" wrote[color=darkred]
              > > > JCO wrote:
              > > >
              > > > > I was on a site where the link pointed to JavaScript.Down load(xxxxx)
              > > >
              > > > Assuming you're referring to DownloadFile, that's a function written[/color][/color][/color]
              by[color=blue][color=green][color=darkred]
              > > > the author to open a window. Nothing more.
              > > >
              > > > Please do not top-post. See
              > > > <URL:http://www.jibbering.c om/faq/faq_notes/pots1.html>.[/color]
              > >
              > > So.... isn't it a JavaScript that makes the download functional?[/color]
              >
              > This is in their .js file:
              >
              > function DownloadFile(fi le_id)
              > {
              >[/color]
              PopDownload=win dow.open("/admin/sitez/download.cfm?id ="+file_id+"&si te=<cfou[color=blue]
              >[/color]
              tput>#site#</cfoutput>","Dow nloadWindow","s crollbars,width =400,height=300 ");[color=blue]
              > PopDownload.foc us();
              > }
              >
              > All this function does is open a window with a new page. A pretty
              > straightforward call to window.open(). I didn't click a link so I don't[/color]
              know[color=blue]
              > what happens, but if what you 're seeing is a download dialog, then they
              > have the correct headers for that behaviour set by some (serverside)[/color]
              script[color=blue]
              > in their file /admin/sitez/download.cfm. Once again: there is no[/color]
              javascript[color=blue]
              > involved.
              >
              > And once again, please don't top-post. In other words: please bottom-post.
              > This may seem unnatural at first, thousands of us have gone through that,
              > but eventually you 'll see that it helps the discussion and exchange of
              > ideas. Please do read the link that Michael provided, especially
              > <URL: http://www.jibbering.com/faq/faq_not....html#ps1TopPs >
              > .
              >
              > HTH
              > --
              > Ivo
              > http://www.vansandick.com/
              >
              >[/color]


              Comment

              Working...