i'm trying to upload a song with an html form and a php code. I've found on the net loads of scripts but noone seems to do the work. I mean, it actually uploads little images but when it comes to upload big files (that can be even images and songs) it shows error 1. Here it's the code i've used:
<!-- The data encoding type, enctype, MUST be specified as below -->
<form enctype="multipart/form-data" action="uploader.php" method="POST">
<!-- MAX_FILE_SIZE must precede the file input field -->
<input type="hidden" name="MAX_FILE_SIZE" value="" />
<!-- Name of input element determines name in $_FILES array -->
Send this file: <input name="userfile" type="file" />
<input type="submit" value="Send File" />
</form>
OTHER FILE:
<?php
$uploaddir = '';
$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 {
echo "Possible file upload attack!\n";
}
print_r($_FILES);
print "</pre>";
?>
the problem is that even if i change the value in name="MAX_FILE_SIZE" value="" /> i can't upload those "big" files. I've already changed the value in the php.ini file to 20M