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

Download vs. Play

P: n/a
My original question had to do with forcing a download instead of play for a
known mime type. I got some useful pointers, but, I failed. Can someone
tell me what is going wrong in this code?

<%
Response.Buffer = False
Server.ScriptTimeout = 30000

Response.ContentType = "application/x-unknown" ' arbitrary
fn = "raigarh.wmv"
FPath = "e:\icinema.com\movies\raigarh\" & fn
Response.AddHeader "Content-Disposition", "attachment; filename=" & fn

Set adoStream = CreateObject("ADODB.Stream")
chunk = 2048
adoStream.Open()
adoStream.Type = 1
adoStream.LoadFromFile(FPath)

iSz = adoStream.Size

Response.AddHeader "Content-Length", iSz

For i = 1 To iSz \ chunk
If Not Response.IsClientConnected Then Exit For
Response.BinaryWrite adoStream.Read(chunk)
Next

If iSz Mod chunk > 0 Then
If Response.IsClientConnected Then
Response.BinaryWrite objStream.Read(iSz Mod chunk)
End If
End If

adoStream.Close
Set adoStream = Nothing

Response.End
%>

I copied this from http://www.aspfaq.com/show.asp?id=2161 and saved it to a
file called download.asp However, when I click on the link to Download.asp,
it says it "cannot download download.asp". On Windows XP I do not get even
that, just a page cannot be displayed message.

Please help, I am desperate now!

Thanx,
--
Anil Gupte
k.e.e.n., inc.
Milwaukee, WI
an*******@keeninc.net
www.keeninc.net
www.icinema.com
--
Anil Gupte
k.e.e.n., inc.
Milwaukee, WI
an*******@keeninc.net
www.keeninc.net
www.icinema.com
Jul 22 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Is E: a local drive on the server?

Ray at home

"Anil Gupte" <an*******@maxnetwork.com> wrote in message
news:OF**************@TK2MSFTNGP10.phx.gbl...
My original question had to do with forcing a download instead of play for
a known mime type. I got some useful pointers, but, I failed. Can
someone tell me what is going wrong in this code?

<%
Response.Buffer = False
Server.ScriptTimeout = 30000

Response.ContentType = "application/x-unknown" ' arbitrary
fn = "raigarh.wmv"
FPath = "e:\icinema.com\movies\raigarh\" & fn
%>

I copied this from http://www.aspfaq.com/show.asp?id=2161 and saved it to
a file called download.asp However, when I click on the link to
Download.asp, it says it "cannot download download.asp". On Windows XP I
do not get even that, just a page cannot be displayed message.

Jul 22 '05 #2

P: n/a
Yes, it is the same drive that the .asp file is on.

--
Anil Gupte
k.e.e.n., inc.
Milwaukee, WI
an*******@keeninc.net
www.keeninc.net
www.icinema.com
"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
message news:eB**************@TK2MSFTNGP09.phx.gbl...
Is E: a local drive on the server?

Ray at home

"Anil Gupte" <an*******@maxnetwork.com> wrote in message
news:OF**************@TK2MSFTNGP10.phx.gbl...
My original question had to do with forcing a download instead of play
for a known mime type. I got some useful pointers, but, I failed. Can
someone tell me what is going wrong in this code?

<%
Response.Buffer = False
Server.ScriptTimeout = 30000

Response.ContentType = "application/x-unknown" ' arbitrary
fn = "raigarh.wmv"
FPath = "e:\icinema.com\movies\raigarh\" & fn
%>

I copied this from http://www.aspfaq.com/show.asp?id=2161 and saved it to
a file called download.asp However, when I click on the link to
Download.asp, it says it "cannot download download.asp". On Windows XP I
do not get even that, just a page cannot be displayed message.


Jul 22 '05 #3

P: n/a
Does your IUSR_computer-name account have NTFS permissions to access that
file?

Ray at work

"Anil Gupte" <an*******@maxnetwork.com> wrote in message
news:uJ**************@TK2MSFTNGP09.phx.gbl...
Yes, it is the same drive that the .asp file is on.

--
Anil Gupte
k.e.e.n., inc.
Milwaukee, WI
an*******@keeninc.net
www.keeninc.net
www.icinema.com
"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
message news:eB**************@TK2MSFTNGP09.phx.gbl...
Is E: a local drive on the server?

Ray at home

"Anil Gupte" <an*******@maxnetwork.com> wrote in message
news:OF**************@TK2MSFTNGP10.phx.gbl...
My original question had to do with forcing a download instead of play
for a known mime type. I got some useful pointers, but, I failed. Can
someone tell me what is going wrong in this code?

<%
Response.Buffer = False
Server.ScriptTimeout = 30000

Response.ContentType = "application/x-unknown" ' arbitrary
fn = "raigarh.wmv"
FPath = "e:\icinema.com\movies\raigarh\" & fn
%>

I copied this from http://www.aspfaq.com/show.asp?id=2161 and saved it
to a file called download.asp However, when I click on the link to
Download.asp, it says it "cannot download download.asp". On Windows XP
I do not get even that, just a page cannot be displayed message.



Jul 22 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.