Hey All I have made this upload script but everytime I tried to execute it, it fails and gives me this error.


This is my code in the Upload.php File:

<form enctype='multipart/form-data' action='Upload_File.php' method='POST'>
 Please choose a file: <input name='myfile' type='file' /><br />
 <input type='submit' name='submit' value='Upload' />

And In the Upload_File.php

session_start ();


//get file data

$name = $_FILES['myfile']['name'];
$tmp_name = $_FILES['myfile']['tmp_name'];
$type = $_FILES['myfile'] ['type'];
		///start upload
		if ($type == "video/mpeg" || $type == "video/quicktime")
		$location = "uploads/$name";
		header( 'Location: Index.php' ) ;
				echo "<center><p style='color:#FFF'>File Format Not Supported Please Upload a MP4 File!</p></center>";
	//die("Please select a file!");
		echo "<center><p style='color:#FFF'>Please select a file!</p></center>";


If anyone could provide support it would be much appreciated.

Line 15 of your code:

$type = $_FILES['myfile'] ['type'];

needs to change to:

$type = $_FILES['myfile']['type'];

with no space between ""
Other than that your code worked for me.