通过ajax提交表格

I have this form:

<form id="ugaForm" method="POST" action="/url/upload" target="myFrame"
enctype="multipart/form-data">

Please select a file to upload : <input id="file" type="file" name="file" />
<input type="button" onclick="submitF()" value="upload" />
</form>             

when submitting normally it works perfectly.

I need an ajax post to imitate this exact form submission. This code doesnt work:

function submitF() {
debugger;
var mfile = $("form#ugaForm")[0].file;
var fd = new FormData();    
fd.append( 'file', mfile);

$.ajax({
  url: 'http://localhost/url/upload/',
  data: JSON.stringify({ 'objectData' : fd}),
  cache: false,
  contentType : false,      
    processData: false,
    type: 'POST',
    success: function(data){
        alert(data);
    }
});

If you are submitting something through AJAX then why are you putting it into the form. Just remove the form and keep the other things which were inside it so that it would become like this:

<div id="ugaForm">
    Please select a file to upload : <input id="file" type="file" name="file" />
    <input type="button" onclick="submit()" value="upload" />
</div>

And the JS would be this:

function submitF() {
    debugger;
    var mfile = $("#ugaForm")[0].file;
    var fd = new FormData();
    fd.append('file', mfile);

    $.ajax({
        url: 'http://localhost/url/upload/',
        data: JSON.stringify({
            'objectData': fd
        }),
        cache: false,
        contentType: false,
        processData: false,
        type: 'POST',
        success: function (data) {
            alert(data);
        }
    });
}

Hope it helps.