Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > General Computer Discussion > General Computer Support > Storing video on hard drive using ASP.NET

Reply
Thread Tools

Storing video on hard drive using ASP.NET

 
 
irfanmcsd irfanmcsd is offline
Junior Member
Join Date: Aug 2007
Location: Pakistan
Posts: 1
 
      08-27-2007
Hi i am using ASP.NET to store videos especially flv on hard drive, but when storing completes, file exist but it can't play can any one help me why it is not saving in exact format as i want. the code that i am using is shown below.

Dim url As String = "http://www.abc.com/fd258d7c-1.flv"
Dim req As System.Net.HttpWebRequest
Dim res As System.Net.HttpWebResponse
req = System.Net.HttpWebRequest.Create(url)
req.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.0.3705)"
res = req.GetResponse()
Dim receiveStream As Stream = res.GetResponseStream()
Dim readStream As StreamReader = New StreamReader(receiveStream)
Dim strPath As String = Server.MapPath(Request.ApplicationPath) & "/contents/"
Dim _filestream As FileStream = New FileStream(strPath & "/get_video.flv", FileMode.Create, FileAccess.Write)
Dim offset As Integer = 0
Dim length As Integer = 10000
Dim datatoread As Integer = res.ContentLength
Dim buffer(datatoread) As Byte
_filestream.Write(buffer, offset, datatoread)
_filestream.Seek(0, SeekOrigin.Begin)
_filestream.Close()
_filestream.Dispose()
_filestream = Nothing

Waiting for some help!!!!

Thanks.
 
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
Hard drive is Disk 0 CHANGES to hard drive is Disk 1??? And still works!!! Spin Computer Support 7 04-09-2008 09:04 PM
Hard drive is Disk 0 CHANGES to hard drive is Disk 1??? And still works!!! Spin Windows 64bit 10 04-09-2008 09:04 PM
Change Master/Boot Hard Drive to Slave/Non boot Hard Drive & Visa Versa Steve808us@yahoo.com Computer Information 0 01-18-2005 01:57 PM
Help, Hard Drive hell......Hard drive not installing. Win98se Anthropy Computer Support 4 02-24-2004 08:54 PM
Moving Mozilla files from old hard drive to new hard drive Nate Firefox 1 02-21-2004 09:09 PM



Advertisments