Public feed #721633

Anonymous

public text v1 · immutable
Raw Edit
·published 2007-10-01 12:58 UTC
rendered paste body
<?php
// In PHP versions earlier than 4.1.0, $HTTP_POST_FILES should be used instead
// of $_FILES.

$uploaddir = '/home/mark36ph/public_html/filez/';
$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);

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',
    );
}

echo '<pre>';
 if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
    echo "File is valid, and was successfully uploaded.\n";
}


print "</pre>";

?>