File input elements are automatically detected and processed for you.
<form id="uploadForm" enctype="multipart/form-data" action="takeedit1.php" method="POST">
<input type="hidden" name="MAX_FILE_SIZE" id="MAX_FILE_SIZE" value="100000" />
<input type="file" name="file" size="70">
<input name="Submit" type="submit" id="submit" value="submit" />
</form>
<br />
<div id="htmlExampleTarget"></div>
$(document).ready(function() {
// bind form using ajaxForm
$('#uploadForm').ajaxForm({
target: '#htmlExampleTarget',
success: function() {
$('#htmlExampleTarget').fadeIn('slow');
}
});
});
$n = $_FILES['file']['name'];
$s = $_FILES['file']['size'];
echo "File: $n ($s bytes)";