Ну а зачем тогда input type="submit"?
Юмористы )
<?
if($_FILES) {
exit(print_r($_FILES, 1));
}
?>
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<style>
</style>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
<script>
$(function() {
$('#f').change(function() {
var f = new FormData();
f.append(this.name, this.files[0])
$.ajax({
type: "POST",
url: location,
data: f,
contentType: false,
processData: false,
success: function(msg) {
alert(msg)
},
error: function() {
//
}
});
})
});
</script>
</head>
<body>
<input type="file" name="upl" id="f" />
</body>
</html>