$.ajax success handler not being called
<p>I have this little AJAX script to handle a file upload:</p>

<pre><code>$('body').on('change', '#uploadFile', function() {
    // Post-Data
    var data = new FormData();
    data.append('file', this.files[0]);
    //data.append('foo', 1);

    // Ajax-Call
    $.ajax({
        url: "uploadUserpic.php",
        data: data,
        type: "POST",
        processData: false,
        contentType: false,
        success: function(evt) {
            $("#message").html(data);
        }
    });
});
</code></pre>

<p>The file upload itself works but the message on success (in <code>#message</code>) is not shown. Why is this? Here is the litte PHP script for the upload:</p>

<pre><code>$uploaddir = '../data/';
$uploadfile = $uploaddir . basename($_FILES['file']['name']);

if (move_uploaded_file($_FILES['file']['tmp_name'], $uploadfile)) {
    echo "File Upload OK.\n";
} else {
    echo "Something went wrong\n";
}
</code></pre>