hrushi9 0 Light Poster

I have form having input type file to upload image & other input fields. How to submit form using websocket ?

$("#form").submit(function() {
    "use strict";

    var formURL = $(this).attr("action");
    var postData = new FormData(this);

    //alert(postData);
    $.ajax({
        type: 'POST',
        url: formURL,
        data: postData,
        processData: false,
        contentType: false,
        success: function() {
            $('.content').prepend("<div class='alert alert-success alert-dismissable'><button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button><h4><i class='icon fa fa-check'></i> Yeah!</h4>Occupation Added Successfully!</div>");
        }
    });
    this.reset();
    $('#myModal').modal('hide');

    return false;
});