j007ha Posted August 15, 2008 Share Posted August 15, 2008 is it anyone can tell me how to upload a video by using php? i noe the different of a video file and other file(like .txt,.jpg,...) is about the file size and file type... is this the main problem which cause cannot upload the video by using same method? any help will be very appreciated Quote Link to comment https://forums.phpfreaks.com/topic/119793-how-to-upload-video-and-display-it-like-youtube/ Share on other sites More sharing options...
genericnumber1 Posted August 15, 2008 Share Posted August 15, 2008 http://us.php.net/features.file-upload Uploading of files is the same for video that it is for images, etc. Quote Link to comment https://forums.phpfreaks.com/topic/119793-how-to-upload-video-and-display-it-like-youtube/#findComment-617154 Share on other sites More sharing options...
j007ha Posted August 15, 2008 Author Share Posted August 15, 2008 how come i still cannot upload video? here is my script: <?php if(isset($_POST['upload'])){ if($_FILES['file_name']['size']<=0){ echo "File empty"; }else{ $name = $_FILES['file_name']['name']; $tmp = $_FILES['file_name']['tmp_name']; $size = $_FILES['file_name']['size']; $type = $_FILES['file_name']['type']; if(move_uploaded_file($_FILES['file_name']['tmp_name'],"video/".$_FILES['file_name']['name'])){ echo "Upload Successfull"; }else{ echo "Unable to upload the follwing file".$_FILES['file_name']['name']; } } } ?> <html> <head> <title>Uploading Video</title> </head> <body> <form action="form.php" method="post" enctype="multipart/form-data"> <table border="0" align="center"> <tr> <th>This is the upload video system</th> </tr> </table> <table border="0" align="center"> <tr> <td>Select file :</td> <td><input type="file" name="file_name"/></td> </tr> <tr> <td colspan="2" align="center"><input type="submit" value="Upload" name="upload"/></td> </tr> </table> </form> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/119793-how-to-upload-video-and-display-it-like-youtube/#findComment-617158 Share on other sites More sharing options...
tibberous Posted August 15, 2008 Share Posted August 15, 2008 Do you have a video folder? Do you have write permissions? Which error message are you getting? Do a print_r($_FILES) and see what you get. Quote Link to comment https://forums.phpfreaks.com/topic/119793-how-to-upload-video-and-display-it-like-youtube/#findComment-617163 Share on other sites More sharing options...
j007ha Posted August 15, 2008 Author Share Posted August 15, 2008 yup,i have a video folder... i have try to upload other file which is .txt and some .wmv file which is (7++kb only) n all of this can be done by easily... but i cannot upload a video .wmv which is much more big size i using print_r to debug already...it show me nothing.... ??? Quote Link to comment https://forums.phpfreaks.com/topic/119793-how-to-upload-video-and-display-it-like-youtube/#findComment-617165 Share on other sites More sharing options...
tibberous Posted August 17, 2008 Share Posted August 17, 2008 Oh, it's because your above PHP's max file size or because your browser is time out. Write an uploader in Flash, then set your max file size in your php ini file. Quote Link to comment https://forums.phpfreaks.com/topic/119793-how-to-upload-video-and-display-it-like-youtube/#findComment-618363 Share on other sites More sharing options...
j007ha Posted August 18, 2008 Author Share Posted August 18, 2008 oh~thx...is it any library that i can use it? or any tutorial link?coz im totally new in flash Quote Link to comment https://forums.phpfreaks.com/topic/119793-how-to-upload-video-and-display-it-like-youtube/#findComment-618872 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.