CodeIgniter Forums
Uload a video file of any format and store it i database - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Uload a video file of any format and store it i database (/showthread.php?tid=52930)



Uload a video file of any format and store it i database - El Forum - 07-02-2012

[eluser]rash[/eluser]
Hi,

can anyone help for uploading a video file in database and viewing the video file fetching from database in php.

But i need the video file in any format when uploading and convert the video file to a specific format and play.

Thanks in advance


Uload a video file of any format and store it i database - El Forum - 07-02-2012

[eluser]InsiteFX[/eluser]
Why would you store a video file in the database? You should only store the link to the video file in the database.



Uload a video file of any format and store it i database - El Forum - 07-02-2012

[eluser]rash[/eluser]
ok, so how can i view the video file fetching from database by a link and show all videos are in a specific format.




Uload a video file of any format and store it i database - El Forum - 07-02-2012

[eluser]InsiteFX[/eluser]
You create an video upload area and save the path to your database which you could also store the video information along with it.



Uload a video file of any format and store it i database - El Forum - 07-03-2012

[eluser]rash[/eluser]
Ok, i got it and i wrote the following code in Main page for form submit:

<form method="post" action="test_video_action.php">
YouTube ID: <input type="text" name="YouTubeID" />
<input type="submit" name="submit" value="submit" />
</form>

and in action page for only show the video the code is:

<?php
$action=$_REQUEST['submit'];
if($action=="submit"){
//echo $_POST["YouTubeID"];
?>
&lt;object width="425" height="350"&gt;&lt;param name="movie" value="http://www.youtube.com/v/&lt;?php echo $_POST["YouTubeID"]; ?&gt;"> </param>
&lt;embed src="http://www.youtube.com/v/&lt;?php echo $_POST["YouTubeID"]; ?&gt;" type="application/x-shockwave-flash" width="425" height="350"&gt; &lt;/embed&gt; &lt;/object&gt;
&lt;?php } ?&gt;

Now my question is if the link of an you tube video is "http://www.youtube.com/watch?v=gIbIO4p8ff4&feature=related" then when i passing only the id after "v=" the video shows correctly. But, when i passing the total link in the form it didn't show the video...

can you please give me a solution for both link post, i.e. a user can post only the ID after "v=" or can post the total you tube link and the video play.


Uload a video file of any format and store it i database - El Forum - 07-03-2012

[eluser]InsiteFX[/eluser]
The code you are showing is procedural PHP code and none of it is CodeIgniter code.