hello guys
i’ve got this code to download files. And the thing is that i do not why i can download any file whether its size is above or below the value given for max_file_size. According to the code I eventually put which is described below, it should not download any file which has size above max_file_size = 0 bytes. Nevertheless, it still downloads files with size >0. So, any idea about, why this value for max_file_size is not being useful in stopping the download of files with size above 0?
n"; echo "Size: ".$_FILES['downfile']['size']."
n"; echo "Type: ".$_FILES['downfile']['type']."
n";
// for Windows
if (! copy ($_FILES['downfile']['name'], "C:caca\".$_FILES['downfile']['name'])) {
echo "<h2>File could not be copied</h2>n";
}
else
echo "great";
/* for Linux/Unix
if (! copy ($_POST['downfile'], "/tmp/".$_POST['file_name'])) {
echo "<h2>File could not be copied</h2>n";
}
} */
}
elseif (($_FILES['downfile']['name'] != "none") AND ($_FILES['downfile']['name'] == 0)) {
echo "<h2>File size exceded exceded</h2>n";
}
else {
echo "<h2>You haven't choose a new file to download</h2>n";
}
echo "<HR>n";
}
?>
File to download
Example