jquery upload multiple files from preview code example

Example 1: multiple file select to upload in jquery

// wait for document to load
$(function(){
  
  // use a different language
  // $file prints the file name
  // $ext prints the file extension

  // invoke plugin
  $('#EmPortugues').MultiFile({ 
    max: 6, 
    accept: 'gif|jpg|png'
    STRING: { 
      remove:'Remover', 
      selected:'Selecionado: $file', 
      denied:'Invalido arquivo de tipo $ext!' 
    } 
  });

});

Example 2: upload multiple image using jquery

$('body').on('click', '#upload', function(e){
        e.preventDefault();
        var formData = new FormData($(this).parents('form')[0]);

        $.ajax({
            url: 'upload.php',
            type: 'POST',
            xhr: function() {
                var myXhr = $.ajaxSettings.xhr();
                return myXhr;
            },
            success: function (data) {
                alert("Data Uploaded: "+data);
            },
            data: formData,
            cache: false,
            contentType: false,
            processData: false
        });
        return false;
})