Need Help With Uploading a Video

Hello,

I have the following code that I want to use to upload video files. It works in uploading images and text files, but doesn’t work for video upload. Could someone help me on this? Thanks.

<?php error_reporting(E_ERROR); echo" PHP File Upload"; $form ="
"; if ($_POST['submitbutton']) { $name=$_FILES['myfile']['name']; $type=$_FILES['myfile']['type']; $size=$_FILES['myfile']['size']; $tmpname=$_FILES['myfile']['tmp_name']; $ext = substr($name, strpos($name, '.')); if ($name) { include "files"; move_uploaded_file($tmpname,"files/"."$name".$ext); echo "Your file has been uploaded"; } else echo "You did not select the file"; echo"$form"; } else echo "$form"; ?>

There is no difference what file type you are uploading. Probably your video file is large, and you need to adjust some of php settings in your php.ini (or in .htaccess). Check these parameters:

max_execution_time - time in seconds (must be high enough for your file uploading to complete)
post_max_size - maximum size request with POST method, that PHP will process
upload_max_filesize - maximum size limit for uploading file

You can check any of these settings by creating file say info.php and putting there single line:
[php]

<?php phpinfo() ?>

[/php]

And then upload this file to your site and open it in your browser.

You can read more about adjusting php settings for large files upload here: http://www.radinks.com/upload/config.php

Sponsor our Newsletter | Privacy Policy | Terms of Service