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

how to download wmv file

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.
Aug 18 '08 #1
1 4477
"Gerald" <gm@dataforcesoftware.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
>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
Aug 18 '08 #2

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

Similar topics

5
by: Brandon Walters | last post by:
I wrote a file download module for my website. The reason for the file download module is that my website downloads work on a credit based system. So I need to keep track of and limit daily...
0
by: Buddy Ackerman | last post by:
I am trying to implment a file download via a link such that when clicked, instead of starting the default application for that type of file the user will be presented with a download dialog...
0
by: Rhys666 | last post by:
Basically I have a link that opens my download page and the querystring identifies the type of 'template' Excel spreadsheet has asked to download. The download page reads the querystring,...
4
by: Nathan Sokalski | last post by:
I want to give visitors to my site the option of downloading a generated ..txt file by clicking a button. I know how to generate text files, but how do I cause the browser to pop up one of those...
1
by: a.r.austin | last post by:
Hello, I am trying to download a few files one after another from a remote server. Problem is that I don't know how to, or if I am able at all, set a time out for download. I don't want to time...
3
by: tshad | last post by:
I have a function that downloads a file to the users computer and it works fine. The problem is that I then want the program to rename the file (file.move) to the same name plus todays date. ...
16
by: matt | last post by:
I have used some free code for listing files for download, but I want to send an email to the administrator when the file has been downloaded. I have got some code in here that does it, but it will...
0
by: kain razial | last post by:
ANYOTHER NEEDS ALSO CONTACT ME.I WILL HELP YOU TO GET THAT TEKLA XSTEEL V 12 DOWNLOAD LINK. http://www.sendspace.com/file/zem32r
0
by: kain razial | last post by:
ANYOTHER NEEDS ALSO CONTACT ME.I WILL HELP YOU TO GET THAT TEKLA XSTEEL V 12 DOWNLOAD LINK. http://www.sendspace.com/file/zem32r
1
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
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...
1
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...
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)...
1
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: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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....

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.