By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,654 Members | 1,583 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,654 IT Pros & Developers. It's quick & easy.

dowload script

P: n/a
does anybody have example of file download using
java script

thanks
dave
dv*****@sbcglobal.net
Jul 23 '05 #1
Share this Question
Share on Google+
13 Replies


P: n/a
dvsbis wrote on 15 feb 2005 in comp.lang.javascript:
does anybody have example of file download using
java script


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

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

Jul 23 '05 #2

P: n/a
Evertjan. wrote:
<a href='myFile.txt'
onclick='alert("Use rightclick + save target as");return false'>


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
Jul 23 '05 #3

P: n/a
David Dorward wrote on 15 feb 2005 in comp.lang.javascript:
Evertjan. wrote:
<a href='myFile.txt'
onclick='alert("Use rightclick + save target as");return false'>


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


Clientside scripting always does make assumptions.

one-buttoned mouses eh?

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

Jul 23 '05 #4

P: n/a
Evertjan. wrote:
Clientside scripting always does make assumptions.
No it doesn't - not when you do capability testing with graceful fallback :)

Besides, that wasn't client side scripting, it was system feedback.
one-buttoned mouses eh?


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
Jul 23 '05 #5

P: n/a

"David Dorward" <do*****@yahoo.com> wrote in message
news:cu*******************@news.demon.co.uk...
Evertjan. wrote:
Clientside scripting always does make assumptions.


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

Besides, that wasn't client side scripting, it was system feedback.
one-buttoned mouses eh?


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


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 http://www.WeAreAllTooPreciousToUseW...eWorldUses.com
Jul 23 '05 #6

P: n/a
In article <sZyQd.403059$Xk.26126@pd7tw3no>,
"Simon Wigzell" <si**********@shaw.ca> wrote:
My visitor stats inform me that 98.6% of my visitors are running IE or
Netscape on a MS windows system.


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
Jul 23 '05 #7

P: n/a
Simon Wigzell wrote:
Or no mouse and a keyboard. Or a touch screen. Or ...
My visitor stats inform me that 98.6% of my visitors are running IE or
Netscape on a MS windows system.
What does that have to do with the input device that a user may use (through
choice or otherwise)?
If any other browser or operating system
visits my site they get a rude noise and a succinct message and get
redirected to http://www.WeAreAllTooPreciousToUseW...eWorldUses.com


How sad for you.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Jul 23 '05 #8

P: n/a
Robert wrote on 16 feb 2005 in comp.lang.javascript:
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.


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

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

Jul 23 '05 #9

P: n/a
Evertjan. wrote:
Robert wrote on 16 feb 2005 in comp.lang.javascript:
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.


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


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.
Jul 23 '05 #10

P: n/a
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="setup.exe"
strFilePath=server.mappath("/downloads/setup.exe")
set fso=createobject("scripting.filesystemobject")
set f=fso.getfile(strfilepath)
strFileSize = f.size
set f=nothing: set fso=nothing
Const adTypeBinary = 1
Response.Clear
Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Open
objStream.Type = adTypeBinary
objStream.LoadFromFile strFilePath
strFileType = "application/zip" ' change to the correct content type for
your file
Response.AddHeader "Content-Disposition", "attachment; filename=" &
strFileName
Response.AddHeader "Content-Length", strFileSize
Response.Charset = "UTF-8"
Response.ContentType = strFileType
Response.BinaryWrite objStream.Read
Response.Flush
objStream.Close
Set objStream = Nothing
%>




"dvsbis" <da******@sbcglobal.net> wrote in message
news:Sl***************@newssvr21.news.prodigy.com. ..
does anybody have example of file download using
java script

thanks
dave
dv*****@sbcglobal.net

Jul 23 '05 #11

P: n/a
dvsbis wrote:
here is a sample of code <%
Response.Buffer = True
strFileName="setup.exe"


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
Jul 23 '05 #12

P: n/a
JRS: In article <sZyQd.403059$Xk.26126@pd7tw3no>, dated Wed, 16 Feb
2005 03:19:52, seen in news:comp.lang.javascript, Simon Wigzell
<si**********@shaw.ca> posted :

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 http://www.WeAreAllTooPreciousToUseW...eWorldUses.com

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.com/faq/> JL/RC: FAQ of news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
Jul 23 '05 #13

P: n/a
In article <sZyQd.403059$Xk.26126@pd7tw3no>, si**********@shaw.ca enlightened
us with...

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 http://www.WeAreAllTooPreciousToUseW...eWorldUses.com


You should instead direct them to
http://www.ImTooStupidToCodeUsingSta...ntBrowsers.com

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.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #14

This discussion thread is closed

Replies have been disabled for this discussion.