473,386 Members | 1,745 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,386 software developers and data experts.

Trying to find the author of a script

I use a script to force the browser to save instead of displaying a
simple text file. I downloaded the script some time ago and I don't
remember where I got it from. Does anyone recognize this script and if
so, do you know the author of this script:

------------------------------------
<%
' Constants for Reading Text File
Const ForAppending = 8
Const ForReading = 1
Const ForWriting = 2
Const TristateFalse = 0
Const TristateMixed = -2
Const TristateTrue = -1
Const TristateUseDefault = -2

' File System Objects
Dim FSO
Dim TS

' Server File (this is the REAL name of the file)
Dim strFile: strFile = Server.MapPath("mybas1.bas")

' File to Save As (this is the name you want to tell the browser)
Dim strFileSave: strFileSave = "mybas2.bas"

' Tell Browser what the file name is, so it doesn't try to save as
"default.asp"
Call Response.AddHeader("Content-Disposition","attachment;
filename=""" & strFileSave & """")

' Write out content-type that will FORCE user to SAVE FILE.
' "image/gif" will display in browser
Response.ContentType = "bad/type"

' Initialize File System Object
Set FSO = Server.CreateObject("Scripting.FileSystemObject")

' Open TextStream for Reading
Set TS = FSO.GetFile(strFile).OpenAsTextStream(ForReading,T ristateTrue)

' TS.ReadAll DOES NOT WORK. Every Byte must be read and written
individually.
' I think you can read them in Chucks, but this was easier. If
you know how to
' Read chunks... go ahead, read chunks ;)
Do While Not (TS.AtEndOfStream)
' Output MUST be BinaryWrite
Response.BinaryWrite(TS.Read(1))
Loop

' Cleanup, like all good programmers do.
TS.Close
Set TS = Nothing
Set FSO = Nothing

' You don't need this, but I like it.
Response.End
%>
-------------------------------

Many thanks in advance,

Arguich811
Arguich811*digitalice*com
Jul 19 '05 #1
4 1522
Arguich811 wrote on 19 jul 2003 in microsoft.public.inetserver.asp.general:
I use a script to force the browser to save instead of displaying a
simple text file. I downloaded the script some time ago and I don't
remember where I got it from. Does anyone recognize this script and if
so, do you know the author of this script:

------------------------------------
<%
' Constants for Reading Text File
Const ForAppending = 8


<http://www.experts-exchange.com/Web/Web_Languages/ASP/Q_20393415.html>

[tnx go to google]

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 19 '05 #2
Thanks for your effort Evert Jan, but I had already Googled it and the
author of the referred posting has confirmed that he is not the
author.

Arguich811
arguich811*digitalrice*com
"Evertjan." <ex**************@interxnl.net> wrote in message news:<Xn********************@194.109.133.29>...
<http://www.experts-exchange.com/Web/Web_Languages/ASP/Q_20393415.html>

[tnx go to google]

Jul 19 '05 #3
Does it matter who the author is?

Does the script work? Do you have a problem with it?

Chris.

"Arguich811" <ar********@digitalrice.com> wrote in message
news:89**************************@posting.google.c om...
Thanks for your effort Evert Jan, but I had already Googled it and the
author of the referred posting has confirmed that he is not the
author.

Arguich811
arguich811*digitalrice*com
"Evertjan." <ex**************@interxnl.net> wrote in message news:<Xn********************@194.109.133.29>...
<http://www.experts-exchange.com/Web/Web_Languages/ASP/Q_20393415.html>

[tnx go to google]

Jul 19 '05 #4
Hi Chis,

No it doesn't matter who he /she is exactly, the script is just working
fine. I just would have liked to give the author some feedback so I hoped
someone might recognize it.

Arguich811

"Chris Barber" <ch***@blue-canoe.co.uk.NOSPAM> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Does it matter who the author is?

Does the script work? Do you have a problem with it?

Chris.

Jul 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Jane Doe | last post by:
Hi I took a quick look in the archives, but didn't find an answer to this one. I'd like to display a list of HTML files in a directory, showing the author's name between brackets after the...
2
by: DonMiche | last post by:
I'm having trouble producing an xml output from another xml file using xsl. The proper values are output to the browser as text with no formating or xml tags (<rowset> and <row>). Any ideas? ...
9
by: JimO | last post by:
I'm a newbie at this and I can't seem to find a list properties names to change styles on the fly. So far I've been lucky and managed to guess the names such as BodyElement.style.marginTop = 0;...
25
by: Neo Geshel | last post by:
This works: <form> <asp:TextBox id="name" /> <%= name.ClientID %> </form> But this DOES NOT work: <form>
4
by: 28tommy | last post by:
Hi, I'm trying to find scripts in html source of a page retrieved from the web. I'm trying to use the following rule: match = re.compile('<script + src=+>') I'm testing it on a page that...
11
by: Rob | last post by:
I know, I know, don't use frames. Well, I'm stuck with these frames and I'm trying to add functionality without a complete redsign. You can look at this as a nostalgic journey. Anyway, I've got...
6
by: Mel | last post by:
is there a way of pointing to a directory where all JScripts are living and let it pick and choose what it needs from which scripts or do I have to do the picking through files each time I write a...
3
by: =?Utf-8?B?R3JlZyBN?= | last post by:
Hello, I'm running an asp.net, intranet web application using .net framework 1.1 on IIS5.1 / 6.0. Through the web application, I would like to press a button on the web page, have another window...
1
by: Sunray | last post by:
I have a form called the sales form and i have 2 sets of listboxes So what happens is. i add items form the bottom set of list boxes which are bound to a data base to the top set of list boxes which...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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,...
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...

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.