Click here to Skip to main content
15,911,531 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
How can i store videos in database and then how can i play it by clicking on it. just like in YouTube
Posted

Don't

Do not store files in a database, I see this type of question alot and I've never seen a good reason to do so.

Store the location of the video-file in the database.

You might want to look at this article
Upload and Convert Video file to Flash Video (flv) and Progressive Streaming using ASP.NET handler[^]
 
Share this answer
 
Comments
Ed Nutting 28-Sep-11 12:49pm    
Good answer, just what I said. You must've posted before me but I hadn't refreshed :P Nice link too, Ed :)
Simon Bang Terkildsen 28-Sep-11 12:51pm    
Thank you, Edward.
Asad_Iqbal 29-Sep-11 3:12am    
Thanks for the help bro didn't know that at all.
What you're asking is an immense task and one that is impossible how you want to go about doing it. Far better would be to have a file server for your videos, name each file (when you save it to your file server by say FileUpload in a web page) with a Guid then store that Guid in a record with the details fo the file in your database. For example your table would include:

VideoId - Both the primary key of the table and the Guid of the file name for the actual video file.
Name - The name of the video, specified by a user presumably
Description - As above but a description
Duration - Store the duration of the file when you save it for later use, can be useful for sorting videos for example
Tags - You may wish to tag users?

What you wish to do is an immense task and I really would suggest you start with something easier if you weren't able to work this one out for yourself.

Best of luck, taking on YouTube sounds crazy to me given that it's owned by Google,

Hope this helps, Ed :)
 
Share this answer
 
Comments
Simon Bang Terkildsen 28-Sep-11 12:53pm    
My 5 for your answer.
I'm abit embarresed that I didn't know Google own YouTube. Did they buy it or did Google actually create YouTube?
Ed Nutting 28-Sep-11 12:59pm    
They bought it a while ago and are/have gradually merged it with Google Videos - the two might as well be the same thing except for the fact that Google Videos will also pull videos from other sites than YouTube - same technology though :) - Edit: You may want to read this (first search off Google :) ) - Dated 2006 http://www.msnbc.msn.com/id/15196982/ns/business-us_business/t/google-buys-youtube-billion/
Simon Bang Terkildsen 28-Sep-11 13:00pm    
ok, thank you for getting me up to speed :)
Ed Nutting 28-Sep-11 13:02pm    
That's okay :)
Asad_Iqbal 29-Sep-11 3:11am    
Thanks allot brother i appreciate for increasing my knowledge, i was unaware of that.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900