473,320 Members | 2,161 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,320 software developers and data experts.

Download vs. Play

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

Similar topics

2
by: Matthew Sims | last post by:
Is it possible to force a download without using the readfile function? My website setup consists of my server that serves the web pages plus a high-speed file server elsewhere on the internet...
7
by: atse | last post by:
Hi, I want the MP3 audio files to be able to download by users only. Even I set the pages validated by session, anyone still can type the download url to get my files without access of the pages...
3
by: BOHICA | last post by:
I would like on my page when users click one of my mp3 files for the dialog box to pop up so they can choose to save the file to disk instead of trying to open through IE, but the dang thing won't...
3
by: nick | last post by:
For example, I want to create a link to download html or mp3 file instead of show it in browser or launch media player to play it....
7
by: Anil Gupte | last post by:
Hi! this may be a trivial question, and may not even involve asp, but let me try.... I want people to click on a .wmv file on a website and download it. Currently, when they do that it simply...
6
by: chon | last post by:
I have an ASP page that is sent a file location as a parameter. It opens this file, loads the ADODB.Stream object and does a binary write to the page forcing the download dialog to appear. This...
4
by: Kevin Muenzler, WB5RUE | last post by:
How do I force a browser to download a file instead of displaying it? In other words I have a page with MP3 and WMA files on it and I would like for the visitor to download the file instead of...
3
by: serkan ulucan | last post by:
Hi, I want to add a video link on web form. Up on clicking this link what I want is that first downloading video automatically without asking where to download, then play the downloaded video. I...
4
rajiv07
by: rajiv07 | last post by:
Hi To all, I have a script for downloading file from the server.The Problem is when i try to download WMA file it get download but it is not playing.when i try to play this file in Windows Media...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.