Uploaded Video not played in browser in php -
I am creating a website. Where I want the user to upload videos there and play whenever they want.
I am capable of uploading videos but when I want to play that or any other video (other video) which does not play in the browser, I know where I am going, but the problem I can not find
My code here for the upload video:
& lt; Form action = "video.php" method = "post" encrypt = "multipart / form-data" & gt; & Lt; Period & gt; Add video here & lt; / Span & gt; & Lt; P & gt; & Lt; Label & gt; Give a caption for the video & lt; / Label & gt; & Lt; Input type = "text" name = "caption" title = "caption" & gt; & Lt; / P & gt; & Lt; Input type = "file" name = "file" id = "files" value = "upload photo" style = "border: 0" & gt; & Lt; Input type = "submit" name = "upload" id = "uploadph" value = "upload video" & gt; & Lt; / Form & gt; PHP code video.php:
$ Allowed exset = array ("AV", "wmv", "mp4"); $ Temp = Explosion (".", $ _FILES ["file"] ["name"]); $ Extension = end ($ temp); $ Filename = $ _ files ["file"] ["name"]; $ Filepath = $ path $ file name. Transcript $$ filepath; If ($ $ _FILES ["file"] ["type"] == "video / x-ms-wmv") || ($ _ files ["file"] ["type"] == "video / avi ") ($ _FILES [" file "] [" type "] ==" video / mp3 ") and amp; and_are ($ extension, $ allowed)) {echo" 1 "; If ($ _FILES ["file"] ["error"]> gt; 0) {resonant "code of return:" $ _FILES ["file"] ["error"] "& Lt; br & gt;"; Echo "sdfsd"; } And {echo "2"; Move_uploaded_file ($ _ files ["file"] ["tmp_name"], "upload / / fileename"); Echo "stored in:" "upload" $ _FILES ["file"] ["name"]; } Uploading it to the Uploads folder. When I want to play it, it does not play. Code to run code:
& lt; Html & gt; & Lt; Body & gt; & Lt; Width of video = "320" height = "240" control = "true" scale = "aspect" & gt; & Lt; Source src = "upload / test .avi" height = "100" width = "100" & gt; & Lt; / Video & gt; & Lt; / Body & gt; & Lt; / Html & gt; Please anyone can help me on this.
Thank you.
& lt ;! - BEGIN General Browser Browser for all browsers Microsoft HTML - & gt; & Lt; Object ID = "Media Player 1" width = "150" height = "170" square = "CLSID: 22d6f-312-BFF-6-11D-9 4B-0080C74C7E95" codebase = "Http://activex.microsoft.com/activex/controls/Mplayer/en/nsmp2inf.cab # version = 5,1,52,701" standby = "Loading Microsoft Windows® Media Player components ..." type = "Application / x-olebject" align = "middle" & gt; & Lt; Param name = "filename" value = "test.avi" & gt; & Lt; Param name = "ShowStatusBar" value = "true" & gt; & Lt; Param name = "DefaultFrame" value = "mainframe" & gt; & Lt; Param name = "autostart" value = "false" & gt; & Lt; Embed type = "App / X-Empler 2" plugins = "http://www.microsoft.com/Windows/MediaPlayer/" src = "upload / test .avi" autostart = "false" align = "middle" width = "150" height = "170" defaultframe = "trueframe" showstatusbar = "true" & gt; & Lt; / Embed & gt; & Lt; / Object & gt;
Comments
Post a Comment