Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > how to download wmv file

Reply
Thread Tools

how to download wmv file

 
 
Gerald
Guest
Posts: n/a
 
      08-18-2008
I want the user to be able to download WMV files. I get an error with the
following code.
Any suggestions appreciated

Gerald


MY CODE
<%
Response.ContentType = "application/xunknown"
Response.AddHeader "content-disposition","attachment;
filename=http://www.facethewind.com/videos/may29_01.mpg"
set adoStream = Server.CreateObject("ADODB.Stream")
adoStream.Type = 1
vUrl = "URL=http://www.facethewind.com/videos/may29_01.mpg"
chunk = 2048
adoStream.Open vUrl, adModeRead
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 adoStream.Read(iSz Mod chunk)
End If
End If
Response.Flush
adoStream.Close
Set adoStream = Nothing
Response.End

%>

ERROR MESSAGE
Internet Explorer cannot download testdownload.asp from www.test.com
Internet Explorer was not able to open this Internet site. The requested
site is either unavailable or cannot be found.


 
Reply With Quote
 
 
 
 
Jeff Dillon
Guest
Posts: n/a
 
      08-18-2008
"Gerald" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
>I want the user to be able to download WMV files. I get an error with the
>following code.
> Any suggestions appreciated
>
> Gerald
>
>
> MY CODE
> <%
> Response.ContentType = "application/xunknown"
> Response.AddHeader "content-disposition","attachment;
> filename=http://www.facethewind.com/videos/may29_01.mpg"
> set adoStream = Server.CreateObject("ADODB.Stream")
> adoStream.Type = 1
> vUrl = "URL=http://www.facethewind.com/videos/may29_01.mpg"
> chunk = 2048
> adoStream.Open vUrl, adModeRead
> 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 adoStream.Read(iSz Mod chunk)
> End If
> End If
> Response.Flush
> adoStream.Close
> Set adoStream = Nothing
> Response.End
>
> %>
>
> ERROR MESSAGE
> Internet Explorer cannot download testdownload.asp from www.test.com
> Internet Explorer was not able to open this Internet site. The requested
> site is either unavailable or cannot be found.
>


Any reason not to use just an <a href..> link? Right click, Save Target
As...

Jeff


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Re: Download WMV files John Doe Firefox 0 10-23-2012 11:50 AM
Download WMV Files From News Websites. xoom7 Computer Support 3 12-03-2007 10:08 PM
Q: HTML To Facilitate Video (.wmv) Download Arthur Shapiro HTML 1 08-15-2005 12:56 AM
Using ASP page to download .wmv file RJT ASP .Net 1 01-17-2005 12:20 PM



Advertisments