rendered paste body<title>Image Upload</title>
<form name="upload" method="post" action="" enctype="multipart/form-data">
<input type="file" name="imagefile" />
<br />
<input type="submit" name="submit" value="Upload!" /><br /><br />
<?php
$unique = md5(time());
$name = substr($unique,1,6);
$ext = '.wmv';
if (isset($_POST['submit']))
{
$tmp_name = $HTTP_POST_FILES['imagefile']['tmp_nme'];
echo "the full name is".$tmp_name;
$ext = explode(".", $tmp_name);
if ($ext == 'wmv'){
?>
<div id="uploading"><img src="circle-ball-dark-antialiased.gif> Uploading...</div>
<?php
copy($_FILES['imagefile']['tmp_name'], "images/" . $name.$ext) or die ("Could not copy");
?>
<script>
document.getElementById('uploading').innerHTML = 'Upload Complete.';
</script>
<?php
}
else{
echo "Could not copy, Wrong file type";
}
}
?>