473,787 Members | 2,989 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

dowload script

does anybody have example of file download using
java script

thanks
dave
dv*****@sbcglob al.net
Jul 23 '05
13 1916
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" <da******@sbcgl obal.net> wrote in message
news:Sl******** *******@newssvr 21.news.prodigy .com...
does anybody have example of file download using
java script

thanks
dave
dv*****@sbcglob al.net

Jul 23 '05 #11
dvsbis wrote:
here is a sample of code <%
Response.Buffer = True
strFileName="se tup.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$X k.26126@pd7tw3n o>, dated Wed, 16 Feb
2005 03:19:52, seen in news:comp.lang. javascript, Simon Wigzell
<si**********@s haw.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.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.
Jul 23 '05 #13
In article <sZyQd.403059$X k.26126@pd7tw3n o>, si**********@sh aw.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
12987
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 scripts. Being a javascript newbie and after significant testing, I suspect that the document.write fails after finding a </script> within pageVar. Does a trick exist that enables one to slightly alter pageVar whereby enabling...
2
2517
by: marcos | last post by:
sorry, but my english are very bad... how lto dowload visual basic 6.0 from internet?
3
2959
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 of the script gets executed. Can someone please give me a direction as to what I may be missing? Thanks.
2
2972
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
1499
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 this: ...pdf Generation.. Response.Clear(); Response.ContentType = "application/pdf";
19
3827
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
1790
by: nkamalnath | last post by:
hi, How to dowload a file using javascript.
2
1764
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. Thanks & Regards, Naimesh Trivedi
1
47489
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 on a link and after a moment or two a file download dialog box pops-up in your web browser and prompts you for some instructions, such as “open” or “save“. I’m going to show you how to do that using a perl script. What You Need Any recent...
0
9497
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10363
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8993
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6749
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5398
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5534
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4067
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3670
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.