how do postAjax with php using multiple file upload

View: New views
1 Messages — Rating Filter:   Alert me  

how do postAjax with php using multiple file upload

by luciano mazzetto :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

My post ajax it's ok, file inputs will be send too..
but multiple upload of images no sucess.

how post ajax multiple file upload if the values aren't in input file ?

code:
$(document).ready(function() {
        // upload imgs
        var fileMax = 10;
        $('#mUpload').after('<div id="files_list" class="box-file">file (max'+fileMax+'):</div>');
        $("input.upload").change(function(){
                doIt(this, fileMax);
        });
});


function doIt(obj, fm) {
        if($('input.upload').size() > fm) {alert('limit upload: '+fm+' images.'); obj.value='';return true;}
        $(obj).hide();
        $(obj).parent().prepend('<input type="file" class="upload" name="fileX[]" id="photo" size="50" />').find("input").change(function() {doIt(this, fm)});
        var v = obj.value;
        if(v != '') {
                $("div#files_list").append('<div style="margin-top:5px;"> ' +v+ ' </div>')
                        .find(".remove").click(function(){
                        $(this).parent().remove();
                        $(obj).remove();
                        return true;
                });
        }
}

                <div id="mUpload">
        <input name="fileX[]" type="file" class="upload" id="photo" size="50" />
  </div>