ecabrera Posted March 7, 2012 Share Posted March 7, 2012 is there a way to upload video i try uploading video but wont let me <?php $name = $_FILES['upload']['name']; $ext = strtolower(substr($name,strpos($name,'.') +1)); $size = $_FILES['upload']['size']; $maxsize = 1073741824; $tmp = $_FILES['upload']['tmp_name']; $move = "uploads/"; if(isset($name)){ if(!empty($name)){ if($size <= $maxsize){ if($ext == 'flv' || $ext == 'fla' || $ext == 'mp4'){ if(move_uploaded_file($tmp,$move.$name)){ echo "Uploaded"; }else echo "Error has happen try again later"; }else echo "Image must be a jpg, jpeg, or png"; }else echo "You must select a smaller image size"; }else echo "You must select a image"; } ?> <form action="video.php" method="post" enctype="multipart/form-data" > <input type="file" name="upload" /><br> <input type="submit" name="submitbtn" /> </form> Quote Link to comment https://forums.phpfreaks.com/topic/258451-upload-videos/ Share on other sites More sharing options...
blacknight Posted March 7, 2012 Share Posted March 7, 2012 what error are you getting so we can help more lol Quote Link to comment https://forums.phpfreaks.com/topic/258451-upload-videos/#findComment-1324801 Share on other sites More sharing options...
ecabrera Posted March 7, 2012 Author Share Posted March 7, 2012 Well i get no error it just doenst say anything im doing it of a localhost if i chage the $ext type to an image it works Quote Link to comment https://forums.phpfreaks.com/topic/258451-upload-videos/#findComment-1324908 Share on other sites More sharing options...
xyph Posted March 7, 2012 Share Posted March 7, 2012 Yes, there is a way. Please ask more specific questions. We aren't a personal debugging service. Quote Link to comment https://forums.phpfreaks.com/topic/258451-upload-videos/#findComment-1324923 Share on other sites More sharing options...
ecabrera Posted March 7, 2012 Author Share Posted March 7, 2012 OK my script has a problem everytime i try to upload a video nothing show up no errors or nothing Quote Link to comment https://forums.phpfreaks.com/topic/258451-upload-videos/#findComment-1324952 Share on other sites More sharing options...
blacknight Posted March 7, 2012 Share Posted March 7, 2012 seee xyph signature put that code at the top of the page the form posts too then try agian Quote Link to comment https://forums.phpfreaks.com/topic/258451-upload-videos/#findComment-1324993 Share on other sites More sharing options...
ecabrera Posted March 7, 2012 Author Share Posted March 7, 2012 I DID that was the first thing i tryed but like i said when i press the submit button NOTHING HAPPENS Quote Link to comment https://forums.phpfreaks.com/topic/258451-upload-videos/#findComment-1325011 Share on other sites More sharing options...
marcus Posted March 7, 2012 Share Posted March 7, 2012 Give us more specifics. What kind of "video" are you uploading? Is it an mpeg, avi, mov, wmv? What's the file size? How long does it take to reproduce the results of, and I quote, "NOTHING HAPPENS"? Quote Link to comment https://forums.phpfreaks.com/topic/258451-upload-videos/#findComment-1325013 Share on other sites More sharing options...
blacknight Posted March 7, 2012 Share Posted March 7, 2012 check your webhost for file types not allowed that could be your issue Quote Link to comment https://forums.phpfreaks.com/topic/258451-upload-videos/#findComment-1325014 Share on other sites More sharing options...
ecabrera Posted March 8, 2012 Author Share Posted March 8, 2012 I have the code up on top it tells what type and the size Quote Link to comment https://forums.phpfreaks.com/topic/258451-upload-videos/#findComment-1325019 Share on other sites More sharing options...
blacknight Posted March 8, 2012 Share Posted March 8, 2012 are you using a webhost.. and tell me the form and code are in the video.php file... Quote Link to comment https://forums.phpfreaks.com/topic/258451-upload-videos/#findComment-1325020 Share on other sites More sharing options...
ecabrera Posted March 8, 2012 Author Share Posted March 8, 2012 yes the file is video.php and no im using localhost Quote Link to comment https://forums.phpfreaks.com/topic/258451-upload-videos/#findComment-1325021 Share on other sites More sharing options...
blacknight Posted March 8, 2012 Share Posted March 8, 2012 good open your php.ini search for "File Uploads" make sure they are on whats the max upload size find "post_max_size" whats its value? Quote Link to comment https://forums.phpfreaks.com/topic/258451-upload-videos/#findComment-1325023 Share on other sites More sharing options...
ecabrera Posted March 8, 2012 Author Share Posted March 8, 2012 post_max_size = 8M Quote Link to comment https://forums.phpfreaks.com/topic/258451-upload-videos/#findComment-1325032 Share on other sites More sharing options...
blacknight Posted March 8, 2012 Share Posted March 8, 2012 question is how big is the file you are uploading Quote Link to comment https://forums.phpfreaks.com/topic/258451-upload-videos/#findComment-1325033 Share on other sites More sharing options...
ecabrera Posted March 8, 2012 Author Share Posted March 8, 2012 9mb cant i just change it to like 30mb Quote Link to comment https://forums.phpfreaks.com/topic/258451-upload-videos/#findComment-1325035 Share on other sites More sharing options...
blacknight Posted March 8, 2012 Share Posted March 8, 2012 yea then restart your webserver Quote Link to comment https://forums.phpfreaks.com/topic/258451-upload-videos/#findComment-1325037 Share on other sites More sharing options...
ecabrera Posted March 8, 2012 Author Share Posted March 8, 2012 ok it work thanks a lot your the man one last question how would i open i in a browers Quote Link to comment https://forums.phpfreaks.com/topic/258451-upload-videos/#findComment-1325038 Share on other sites More sharing options...
blacknight Posted March 8, 2012 Share Posted March 8, 2012 depends on teh file type search google for video embed code for **** with the file types you want Quote Link to comment https://forums.phpfreaks.com/topic/258451-upload-videos/#findComment-1325040 Share on other sites More sharing options...
ecabrera Posted March 8, 2012 Author Share Posted March 8, 2012 thanks Quote Link to comment https://forums.phpfreaks.com/topic/258451-upload-videos/#findComment-1325041 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.