Retrieving Video Files from database

Last post 06-08-2009 9:10 AM by aditya1986. 10 replies.

Sort Posts:

  • Retrieving Video Files from database

    06-08-2009, 2:54 AM
    • Member
      point Member
    • hkkarri
    • Member since 05-25-2009, 7:16 AM
    • Posts 16
    Hello Friends, I'm storing Video files into the database and when required, i retrieve them and store them on the folder. Issue: Before storing the video file in to the database, the size is 2 mb and after retrieving , its 10mb. This is the method i use to retrieve the files, Dim fs As New FileStream(path, FileMode.CreateNew) fs.Write(bimagedata, 0, bimagedata.Length) Dim bw As New BinaryWriter(fs) Dim i As Integer For i = 0 To bimagedata.Length bw.Write(CInt(i)) Next i Can someone please tell me a better way to retrieve and store the video files in a folder. Thanks in advance. hkk
  • Re: Retrieving Video Files from database

    06-08-2009, 3:57 AM
    • Star
      10,561 point Star
    • getchinna_sv
    • Member since 09-10-2008, 8:29 PM
    • Hyderabad
    • Posts 1,796

    can you post your code in a formated way....

    go to editprofile...siteoptions ..... content editor ..... select Standerd...

     

    Chinna_sv...
  • Re: Retrieving Video Files from database

    06-08-2009, 4:07 AM
    Answer
    • Participant
      1,322 point Participant
    • ezhillmaran
    • Member since 02-15-2008, 11:09 AM
    • Chennai
    • Posts 277

    Why do you want to store video files in DB? Storing them as binary data within the DB will put a very heavy load on your DB server. I would prefer to store them in file system and store URLs in your DB.

    thnks n regards,
    Maran.


  • Re: Retrieving Video Files from database

    06-08-2009, 4:21 AM
    • Member
      point Member
    • hkkarri
    • Member since 05-25-2009, 7:16 AM
    • Posts 16
    True.. doing it right away. Thanks.
  • Re: Retrieving Video Files from database

    06-08-2009, 4:54 AM

    I assume that you are storing and retrieving video files in SQL Server 2005 database. 

    Try the code given in the following link: 

    http://support.microsoft.com/default.aspx?scid=kb;en-us;326502

     

    Check this link also:

    http://weblogs.sqlteam.com/randyp/archive/2008/11/20/60771.aspx

  • Re: Retrieving Video Files from database

    06-08-2009, 5:13 AM
    • Member
      point Member
    • hkkarri
    • Member since 05-25-2009, 7:16 AM
    • Posts 16
    Hey, I stored the path in the database and the file on the file system. I read it using the filestream.. FileUpload.PostedFile.InputStream.Read(arrContent, 0, intLength) I write it using fs.write Dim fs As New FileStream(imagepath, FileMode.CreateNew) fs.Write(arrContent, 0, intLength) Dim bw As New BinaryWriter(fs) Dim j As Integer For j = 0 To intLength bw.Write(CInt(i)) Next j bw.Close() fs.Close() issues still persists.. A 2MB .MPG4 file get converted to 10MB .MPG4 file. It palys well but the size is the issue. P.S : Oracle 10g is the database i'm using. Any ways, i'm not storing it in the database so, should not be of any newz now.
  • Re: Retrieving Video Files from database

    06-08-2009, 5:50 AM
    • Participant
      1,322 point Participant
    • ezhillmaran
    • Member since 02-15-2008, 11:09 AM
    • Chennai
    • Posts 277

    Why do you want to store your files multiple path?

    if you want to copy files then you can use like this

    File.Copy("sourcefilepath", "destinationfilepath");

    thnks n regards,
    Maran.


  • Re: Retrieving Video Files from database

    06-08-2009, 6:10 AM
    • All-Star
      23,953 point All-Star
    • qwe123kids
    • Member since 03-27-2008, 5:49 AM
    • Mumbai
    • Posts 4,096

     Hi,

    It is not Adivceable for Storing Video in database..

    Rather than use .. Path of  Video file.. and Acess on <embed. or object tag

    Thanks
    Avinash Tiwari

    Remember to click “Mark as Answer” on the post, if it helps you.

    MY Blog

    Hacking Inside .net exe
  • Re: Retrieving Video Files from database

    06-08-2009, 6:28 AM
    • Member
      point Member
    • hkkarri
    • Member since 05-25-2009, 7:16 AM
    • Posts 16
    Hi, I'm not storing the files in the database, i'm storing the path of the file in the database. When a users logs on to my website, he has an option to upload video. So, what i'm doing is reading the file stream and storing it on the filesystem, in a folder. Issue is, when i'm storing it, the file size increases. from 2 mb to 10 mb. How would i be able to use file.copy, its not a desktop application rt. The file is location on the clients computer and i would have to read it any ways to store it rt?
  • Re: Retrieving Video Files from database

    06-08-2009, 6:39 AM
    Answer
    • Participant
      1,322 point Participant
    • ezhillmaran
    • Member since 02-15-2008, 11:09 AM
    • Chennai
    • Posts 277

     I assume your using file upload control right?

    You can save it like this

    fileupload1.save("destination path");

    thnks n regards,
    Maran.


  • Re: Retrieving Video Files from database

    06-08-2009, 9:10 AM
    Answer
Page 1 of 1 (11 items)