here is an example of a simple ajax submit form:
$('#submit').click(function () {
    var myName = $('#name').val();
    var myContent = $('#content').val();
    // ajax
    $.ajax({
        type: 'post',
        url: '/ajax.process.php',
        data: {
            post_name: myName,
            post_content: myContent
        },
        dataType: 'json',
        success: function (data) {
            if (data.status.OK == 'OK') {
                console.log('OK');
                return false;
            } else {
                console.log('ERROR');
                return false;
            }
        }
    }); // end ajax
});
And this is my html:
   <form method='post' enctype='multipart/form-data' action='ajax.process.php' id='form-main'>
     <textarea cols='50' rows='5' id='content' name='post_content'></textarea>
         <input type='text' id='name' class=' name='post_name'>
         <input type='file' id='attach' name='attach'/>
          <input type='button' value='Submit' id='express-form-submit'>
   </form>
Just wondering why all the form works perfectly except for the attach, my server side script never catch a $_FILES.
Any ideas?
 
    