All pastes #364419 Raw Edit

Miscellany

public text v1 · immutable
#364419 ·published 2007-02-20 04:05 UTC
rendered paste body
<?php
// In PHP versions earlier than 4.1.0, $HTTP_POST_FILES should be used instead
// of $_FILES.

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

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

 

print "POSTED";

?>