For on how to upload see here http://us.php.net/features.file-upload
For how to confirm it's the correct file type:
<?php
function image_valid($type)
{
$file_types = array(
'image/pjpeg' => 'jpg',
'image/jpeg' => 'jpg',
'image/jpeg' => 'jpeg',
'image/gif' => 'gif',
'image/X-PNG' => 'png',
'image/PNG' => 'png',
'image/png' => 'png',
'image/x-png' => 'png',
'image/JPG' => 'jpg',
'image/GIF' => 'gif',
'image/bmp' => 'bmp',
'image/bmp' => 'BMP',
);
if(!array_key_exists($type, $file_types))
{
return "FALSE";
}
else
{
return "TRUE";
}
}
if(image_valid($_FILES['user_file']['type']) === "FALSE")
{
die("Image file is not valid");
}
?>
Just replace the correct video/BLANK
I don't know about file converting, but this should allow you to upload.
__________________
PHP Code:
<?php echo "Hello World"; ?>
HTML Code:
<html><head><title>Hello World</title></head><body><p>Hello World</p></body></html>
|