<?php
    if (!empty($_FILES)){
        echo "<pre>";
        echo $_FILES['file']['type'];
        echo "</pre>";
        return;
    }
?>
<script type="text/javascript">
    function autoUpLoad(){
        $("#txtHint").html("<center><img src='include/images/loader.gif' />Reading selected file...</center>");
        $(document).ready(function(){
            $("#file").change(function(){
                $("#myForm").submit(function(data){
                    $("#txtHint").html(data);
                });
            });
        });
    }
</script>
<form id="myForm" method="post" enctype="multipart/form-data">
    <input type="file" name="file" id = "file" onchange='autoUpLoad()'/>
    <input type="submit" value="Send" />
</form>
<div id="txtHint">
    test
</div>
The above code is not working and I am not sure what is wrong here? It works only if I remove these lines:
function(data){
    $("#txtHint").html(data);
}
It just doesn't allow me to return data to txtHint. Can anyone explain to me how to make it work?
 
     
    