<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<?php
// $inis = ini_get_all();
// print_r($inis);
?>
<?php
$filename = $HTTP_POST_FILES['file']['name'];
$tempFilename = $HTTP_POST_FILES['file']['tmp_name'];
$content_type = $HTTP_POST_FILES['file']['type'];
$fd = fopen($tempFilename, "rb");
$data = fread($fd, filesize($tempFilename));
fclose($fd);
echo $data;
?>
<form action="sendfile2.php" method="post">
<input name="file" type="file" />
<input name="submit" type="submit" />
</form>
</body>
</html>
NOTE: sendfile2.php declared in the form action is this file.
You couldn't get more simple, yet $data refuses to echo anything out.
Even when I try and echo the $HTTP_POST_FILES I get nothing, despite uploading and submitting.
It's driving me nuts.