<?php
if (count($_POST)) {
$userfile = $_FILES['userfile']['name'];
$file_size = $_FILES['userfile']['size'];
$file_temp = $_FILES['userfile']['tmp_name'];
$path = 'uploads/';
$randomizer = rand(0000, 9999);
$file_name = $randomizer.$userfile;
if($file_size > 25600) {
echo 'FILE SIZE TO LARGE<BR />';
exit();
}
if (move_uploaded_file($file_temp, $path.$file_name)) {
echo '<h3>Upload Successful!</h3>';
} else {
echo '<h3>ERROR</h3>';
}
}
?>
<form enctype="multipart/form-data" method="post">
Upload File: <input name="userfile" type="file" /> <br />
<input type="submit" value="Upload File" />
</form>
I do have a folder named uploads in my root but still this wont work, i dont even get the error. Getting tired..Whats wrong?