Storing video on hard drive using ASP.NET

Discussion in 'General Computer Support' started by irfanmcsd, Aug 27, 2007.

  1. irfanmcsd

    irfanmcsd

    Joined:
    Aug 27, 2007
    Messages:
    1
    Location:
    Pakistan
    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.
     
    irfanmcsd, Aug 27, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?c2FuanU=?=

    information about asp ,oracle,asp.net certification?

    =?Utf-8?B?c2FuanU=?=, May 18, 2005, in forum: Microsoft Certification
    Replies:
    1
    Views:
    584
    Bob Christian
    May 18, 2005
  2. sovan

    Zip with ASP.NET(Using C#.NET)

    sovan, Jul 6, 2006, in forum: Software
    Replies:
    3
    Views:
    910
    noraao
    Jul 25, 2006
  3. sovan
    Replies:
    0
    Views:
    3,187
    sovan
    Jul 6, 2006
  4. bqmassey

    Storing class with session (ASP.Net)

    bqmassey, Sep 22, 2006, in forum: Software
    Replies:
    0
    Views:
    1,153
    bqmassey
    Sep 22, 2006
  5. london1919
    Replies:
    1
    Views:
    2,962
    Lawrence Garvin \(MVP\)
    Dec 8, 2008
Loading...

Share This Page