Click here to Skip to main content
15,914,780 members
Home / Discussions / Web Development
   

Web Development

 
Questionfiledownloadproblem(ASP) Pin
rajiv_kadam10-Feb-10 19:58
rajiv_kadam10-Feb-10 19:58 
i have to download videos from specific location
it is downloaded but when i play the video which is
downloaded from website is not playing please help me here is my code and my site is www.bigbonenews.net/downloadvideo.asp?id=33

<!--#include file="common.asp"-->












<%
OpenDataBase conn
id=request("id")
'if id="" then response.Write("no news is present")
'sql1="select * from newsvideo"
'set rs=server.createobject("adodb.recordset")
'rs.open sql1,conn,1,1
'while rs.eof<>true


sql="select * from newsvideo where newsid=" & id
set obj=server.createobject("adodb.recordset")
obj.open sql,conn,1,1
if obj.eof<>true then
'response.write(obj("news_titile"))
body="http://www.bigbonenews.net/videos/" & obj("videoname") & vbcrlf
'obj.close
'obj.movenext
end if

Server.ScriptTimeout=600
'OpenDataBase conn
'body="/videos/" & vbcrlf
'response.buffer=true

Dim stream
Dim contents
Dim filename
filename=obj("videoname")
body="http://www.bigbonenews.net/videos/" & filename
response.buffer=true

strFileType = lcase(Right(filename, 4))
'another file code starts here
Select Case strFileType
Case ".asf"
ContentType = "video/x-ms-asf"
Case ".avi"
ContentType = "video/avi"
Case ".doc"
ContentType = "application/msword"
Case ".zip"
ContentType = "application/zip"
Case ".xls"
ContentType = "application/vnd.ms-excel"
Case ".gif"
ContentType = "image/gif"
Case ".jpg", "jpeg"
ContentType = "image/jpeg"
Case ".wav"
ContentType = "audio/wav"
Case ".mp3"
ContentType = "audio/mpeg3"
Case ".mpg", "mpeg"
ContentType = "video/mpeg"
Case ".rtf"
ContentType = "application/rtf"
Case ".htm", "html"
ContentType = "text/html"
Case ".asp"
ContentType = "text/asp"
Case Else
'Handle All Other Files
ContentType = "application/octet-stream"
End Select
response.Write(strFileType)
'rs.close
'conn.close

Response.AddHeader "Content-disposition","attachment;filename=" & filename
response.contenttype=ContentType

response.write body
response.end
%>



<form action="downloadvideo.asp" method="post">
<input type="hidden" name="id" value="<%=id%>">

</form>




<!--starts Main Body -->
<!--startclickprintinclude-->


<!--starts Top News Story -->
AnswerRe: filedownloadproblem(ASP) Pin
T M Gray12-Feb-10 7:38
T M Gray12-Feb-10 7:38 
QuestionProblem accessing QueryString [modified] Pin
sduffield10-Feb-10 9:19
sduffield10-Feb-10 9:19 
AnswerRe: Problem accessing QueryString Pin
thatraja10-Feb-10 18:41
professionalthatraja10-Feb-10 18:41 
GeneralRe: Problem accessing QueryString Pin
sduffield11-Feb-10 10:06
sduffield11-Feb-10 10:06 
AnswerRe: Problem accessing QueryString Pin
Nilesh Hapse10-Feb-10 20:06
Nilesh Hapse10-Feb-10 20:06 
AnswerRe: Problem accessing QueryString Pin
thatraja10-Feb-10 20:24
professionalthatraja10-Feb-10 20:24 
GeneralRe: Problem accessing QueryString Pin
Nilesh Hapse10-Feb-10 20:28
Nilesh Hapse10-Feb-10 20:28 
GeneralRe: Problem accessing QueryString [modified] Pin
thatraja10-Feb-10 23:04
professionalthatraja10-Feb-10 23:04 
GeneralRe: Problem accessing QueryString Pin
sduffield11-Feb-10 10:07
sduffield11-Feb-10 10:07 
QuestionPersonal website engine recommendation. Pin
Giorgi Dalakishvili10-Feb-10 7:34
mentorGiorgi Dalakishvili10-Feb-10 7:34 
QuestionLocations of aspnet files on Windows 7 Pin
Richard Jones10-Feb-10 6:23
Richard Jones10-Feb-10 6:23 
Questionput_innerText / CHTMLView::PutProperty Pin
GBrook10-Feb-10 5:51
GBrook10-Feb-10 5:51 
AnswerRe: put_innerText / CHTMLView::PutProperty Pin
GBrook11-Feb-10 4:53
GBrook11-Feb-10 4:53 
QuestionAccess Web application using IP from others system(In Office)... Pin
spalanivel9-Feb-10 2:28
spalanivel9-Feb-10 2:28 
QuestionEmbedding Flash Version 10 Pin
Paul McGann9-Feb-10 2:00
professionalPaul McGann9-Feb-10 2:00 
QuestionProblem after deployment. Pin
rksdev9-Feb-10 1:17
rksdev9-Feb-10 1:17 
Questionexporting to excel Pin
mabrahao8-Feb-10 8:34
mabrahao8-Feb-10 8:34 
AnswerRe: exporting to excel Pin
Gaurav Dudeja India8-Feb-10 20:15
Gaurav Dudeja India8-Feb-10 20:15 
GeneralRe: exporting to excel [modified] Pin
mabrahao9-Feb-10 1:18
mabrahao9-Feb-10 1:18 
QuestionNot able to start IIS (Default Web Site) Pin
Ankur.Bakliwal8-Feb-10 4:29
Ankur.Bakliwal8-Feb-10 4:29 
AnswerRe: Not able to start IIS (Default Web Site) Pin
R. Giskard Reventlov8-Feb-10 4:40
R. Giskard Reventlov8-Feb-10 4:40 
Questionhow to refresh (not redirect) a HTTPS page with simple html code Pin
john13698-Feb-10 3:04
john13698-Feb-10 3:04 
AnswerRe: how to refresh (not redirect) a HTTPS page with simple html code Pin
thatraja8-Feb-10 6:26
professionalthatraja8-Feb-10 6:26 
QuestionCSS Pin
Morgs Morgan8-Feb-10 0:02
Morgs Morgan8-Feb-10 0:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.