473,391 Members | 1,427 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,391 software developers and data experts.

dowload script

does anybody have example of file download using
java script

thanks
dave
dv*****@sbcglobal.net
Jul 23 '05 #1
13 1886
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
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
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
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

"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
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
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
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Mike Daniel | last post by:
I am attempting to use document.write(pageVar) that displays a new html page within a pop-up window and the popup is failing. Also note that pageVar is a complete HTML page containing other java...
2
by: marcos | last post by:
sorry, but my english are very bad... how lto dowload visual basic 6.0 from internet?
3
by: Water Cooler v2 | last post by:
Questions: 1. Can there be more than a single script block in a given HEAD tag? 2. Can there be more than a single script block in a given BODY tag? To test, I tried the following code. None...
2
by: bilaribilari | last post by:
Hi all, I am using Tidy (C) for parsing html pages. I encountered a page that has some script as follows: <script> .... var abc = "<script>some stuff here</" + "script>"; .... </script>
2
by: comick | last post by:
Hello all, i have a asp.net c# web app 2.0 I have a pdf generation with a third part sw, but i cant download pdf in a new window, from a folder inside my web site. The code i try to use is...
19
by: thisis | last post by:
Hi All, i have this.asp page: <script type="text/vbscript"> Function myFunc(val1ok, val2ok) ' do something ok myFunc = " return something ok" End Function </script>
1
by: nkamalnath | last post by:
hi, How to dowload a file using javascript.
2
by: nbt725 | last post by:
Dear Sir, Hello ! I want to write a script to allow downloading a file from server, which first asks for the path to store the file and then downloads to user's local machine. Please guide me....
1
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Many websites have a form or a link you can use to download a file. You click a form button or click...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.