dowload script

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

    #1

    dowload script

    does anybody have example of file download using
    java script

    thanks
    dave
    dvs_bis@sbcglob al.net


  • Evertjan.

    #2
    Re: dowload script

    dvsbis wrote on 15 feb 2005 in comp.lang.javas cript:
    [color=blue]
    > does anybody have example of file download using
    > java script
    >[/color]

    <a href='myFile.tx t'
    onclick='alert( "Use rightclick + save target as");return false'>
    myFile.txt</a>

    --
    Evertjan.
    The Netherlands.
    (Replace all crosses with dots in my emailaddress)

    Comment

    • David Dorward

      #3
      Re: dowload script

      Evertjan. wrote:
      [color=blue]
      > <a href='myFile.tx t'
      > onclick='alert( "Use rightclick + save target as");return false'>[/color]

      Oooh - making assumptions about the user's browser and mouse.

      --
      David Dorward <http://blog.dorward.me .uk/> <http://dorward.me.uk/>
      Home is where the ~/.bashrc is

      Comment

      • Evertjan.

        #4
        Re: dowload script

        David Dorward wrote on 15 feb 2005 in comp.lang.javas cript:[color=blue]
        > Evertjan. wrote:
        >[color=green]
        >> <a href='myFile.tx t'
        >> onclick='alert( "Use rightclick + save target as");return false'>[/color]
        >
        > Oooh - making assumptions about the user's browser and mouse.[/color]

        Clientside scripting always does make assumptions.

        one-buttoned mouses eh?

        --
        Evertjan.
        The Netherlands.
        (Replace all crosses with dots in my emailaddress)

        Comment

        • David Dorward

          #5
          Re: dowload script

          Evertjan. wrote:
          [color=blue]
          > Clientside scripting always does make assumptions.[/color]

          No it doesn't - not when you do capability testing with graceful fallback :)

          Besides, that wasn't client side scripting, it was system feedback.
          [color=blue]
          > one-buttoned mouses eh?[/color]

          Or no mouse and a keyboard. Or a touch screen. Or ...

          --
          David Dorward <http://blog.dorward.me .uk/> <http://dorward.me.uk/>
          Home is where the ~/.bashrc is

          Comment

          • Simon Wigzell

            #6
            Re: dowload script


            "David Dorward" <dorward@yahoo. com> wrote in message
            news:cuttdm$rod $2$8302bc10@new s.demon.co.uk.. .[color=blue]
            > Evertjan. wrote:
            >[color=green]
            >> Clientside scripting always does make assumptions.[/color]
            >
            > No it doesn't - not when you do capability testing with graceful fallback
            > :)
            >
            > Besides, that wasn't client side scripting, it was system feedback.
            >[color=green]
            >> one-buttoned mouses eh?[/color]
            >
            > Or no mouse and a keyboard. Or a touch screen. Or ...
            >
            > --
            > David Dorward <http://blog.dorward.me .uk/> <http://dorward.me.uk/>
            > Home is where the ~/.bashrc is[/color]

            My visitor stats inform me that 98.6% of my visitors are running IE or
            Netscape on a MS windows system. If any other browser or operating system
            visits my site they get a rude noise and a succinct message and get
            redirected to https://www.WeAreAllTooPreciousToUse...eWorldUses.com


            Comment

            • Robert

              #7
              Re: dowload script

              In article <sZyQd.403059$X k.26126@pd7tw3n o>,
              "Simon Wigzell" <simonwigzell@s haw.ca> wrote:
              [color=blue]
              > My visitor stats inform me that 98.6% of my visitors are running IE or
              > Netscape on a MS windows system.[/color]

              IE and other browsers can report that they are using any browser the
              user wishes. I had to change iCab to say that it was IE on Windows
              because some author only allowed IE in his site.

              Every hear of Firefox?

              Robert

              Comment

              • David Dorward

                #8
                Re: dowload script

                Simon Wigzell wrote:
                [color=blue][color=green]
                >> Or no mouse and a keyboard. Or a touch screen. Or ...[/color][/color]
                [color=blue]
                > My visitor stats inform me that 98.6% of my visitors are running IE or
                > Netscape on a MS windows system.[/color]

                What does that have to do with the input device that a user may use (through
                choice or otherwise)?
                [color=blue]
                > If any other browser or operating system
                > visits my site they get a rude noise and a succinct message and get
                > redirected to https://www.WeAreAllTooPreciousToUse...eWorldUses.com[/color]

                How sad for you.

                --
                David Dorward <http://blog.dorward.me .uk/> <http://dorward.me.uk/>
                Home is where the ~/.bashrc is

                Comment

                • Evertjan.

                  #9
                  Re: dowload script

                  Robert wrote on 16 feb 2005 in comp.lang.javas cript:[color=blue]
                  > IE and other browsers can report that they are using any browser the
                  > user wishes. I had to change iCab to say that it was IE on Windows
                  > because some author only allowed IE in his site.[/color]

                  Personally,
                  I feel no need to accomodate users that give wrong browser info.

                  --
                  Evertjan.
                  The Netherlands.
                  (Replace all crosses with dots in my emailaddress)

                  Comment

                  • Richard Cornford

                    #10
                    Re: dowload script

                    Evertjan. wrote:[color=blue]
                    > Robert wrote on 16 feb 2005 in comp.lang.javas cript:[color=green]
                    >> IE and other browsers can report that they are using any
                    >> browser the user wishes. I had to change iCab to say that
                    >> it was IE on Windows because some author only allowed IE
                    >> in his site.[/color]
                    >
                    > Personally,
                    > I feel no need to accomodate users that give wrong browser info.[/color]

                    The information is only wrong where it is possible to say what would be
                    right. As the information in question usually originates in the HTTP
                    User-Agent header it would be the RFC for HTTP that defined what would
                    be right or wrong in the context of that header, and the HTTP RFCs make
                    no requirements of the content of the user agent headers. Indeed as the
                    RFC for HTTP 1.1 was written at a time when the most popular browser
                    around (IE 4) was itself spoofing by default it was probably not
                    practical for the authors of the RFC to make any more than suggestions
                    about its contents.

                    Richard.


                    Comment

                    • dvsbis

                      #11
                      Re: dowload script

                      here is a sample of code...on my isp web server this works on my intranet
                      server it hangs....i do get a 500
                      internal server error...any ideas...thanks
                      dave
                      Sample Below:

                      <%
                      Response.Buffer = True

                      strFileName="se tup.exe"
                      strFilePath=ser ver.mappath("/downloads/setup.exe")
                      set fso=createobjec t("scripting.fi lesystemobject" )
                      set f=fso.getfile(s trfilepath)
                      strFileSize = f.size
                      set f=nothing: set fso=nothing
                      Const adTypeBinary = 1
                      Response.Clear
                      Set objStream = Server.CreateOb ject("ADODB.Str eam")
                      objStream.Open
                      objStream.Type = adTypeBinary
                      objStream.LoadF romFile strFilePath
                      strFileType = "applicatio n/zip" ' change to the correct content type for
                      your file
                      Response.AddHea der "Content-Disposition", "attachment ; filename=" &
                      strFileName
                      Response.AddHea der "Content-Length", strFileSize
                      Response.Charse t = "UTF-8"
                      Response.Conten tType = strFileType
                      Response.Binary Write objStream.Read
                      Response.Flush
                      objStream.Close
                      Set objStream = Nothing
                      %>










                      "dvsbis" <davepalm@sbcgl obal.net> wrote in message
                      news:SlrQd.355$ OU1.254@newssvr 21.news.prodigy .com...[color=blue]
                      > does anybody have example of file download using
                      > java script
                      >
                      > thanks
                      > dave
                      > dvs_bis@sbcglob al.net
                      >
                      >[/color]


                      Comment

                      • David Dorward

                        #12
                        Re: dowload script

                        dvsbis wrote:
                        [color=blue]
                        > here is a sample of code[/color]
                        [color=blue]
                        > <%
                        > Response.Buffer = True
                        > strFileName="se tup.exe"[/color]

                        That looks like ASP/VBScript. While ASP/JScript might be on topic here, that
                        isn't. I suggest you find a more suitable newsgroup.

                        --
                        David Dorward <http://blog.dorward.me .uk/> <http://dorward.me.uk/>
                        Home is where the ~/.bashrc is

                        Comment

                        • Dr John Stockton

                          #13
                          dowload script

                          JRS: In article <sZyQd.403059$X k.26126@pd7tw3n o>, dated Wed, 16 Feb
                          2005 03:19:52, seen in news:comp.lang. javascript, Simon Wigzell
                          <simonwigzell@s haw.ca> posted :[color=blue]
                          >
                          >My visitor stats inform me that 98.6% of my visitors are running IE or
                          >Netscape on a MS windows system. If any other browser or operating system
                          >visits my site they get a rude noise and a succinct message and get
                          >redirected to https://www.WeAreAllTooPreciousToUse...eWorldUses.com
                          >[/color]


                          That's rather like putting the doorknob on the top edge of the door
                          rather than half-way down the side, and then saying that since all of
                          your visitors that enter are reasonably tall there's no need to bother
                          with short people.


                          I suggest that you ask your legal advisor to inform you about what
                          Canadian equivalent may exist of the US ADA and the UK DAA. That should
                          be done with high priority if your work is used (unlikely as that may
                          seem) by any organisation, commercial, charitable, governmental, or
                          otherwise, that offers services to the public or parts thereof. If your
                          work is not actually useful to anybody, you may, for a while, be safe.
                          Or you may not.

                          --
                          © John Stockton, Surrey, UK. ?@merlyn.demon. co.uk Turnpike v4.00 IE 4 ©
                          <URL:http://www.jibbering.c om/faq/> JL/RC: FAQ of news:comp.lang. javascript
                          <URL:http://www.merlyn.demo n.co.uk/js-index.htm> jscr maths, dates, sources.
                          <URL:http://www.merlyn.demo n.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.

                          Comment

                          • kaeli

                            #14
                            Re: dowload script

                            In article <sZyQd.403059$X k.26126@pd7tw3n o>, simonwigzell@sh aw.ca enlightened
                            us with...[color=blue]
                            >
                            > My visitor stats inform me that 98.6% of my visitors are running IE or
                            > Netscape on a MS windows system. If any other browser or operating system
                            > visits my site they get a rude noise and a succinct message and get
                            > redirected to https://www.WeAreAllTooPreciousToUse...eWorldUses.com
                            >[/color]

                            You should instead direct them to


                            And if you don't know that I can make any browser spoof the User Agent and
                            tell your server that it's IE, you REALLY need to redirect there.

                            --
                            --
                            ~kaeli~
                            Black holes were created when God divided by 0.



                            Comment

                            Working...