FormData()
var form = $('form')[0];
var formData = new FormData(form);

예제
$("form#data").submit(function(event){
 
  //disable the default form submission
  event.preventDefault();
 
  //grab all form data  
  var formData = new FormData($(this)[0]);
 
  $.ajax({
    url: 'formprocessing.php',
    type: 'POST',
    data: formData,
    async: false,
    cache: false,
    contentType: false,
    processData: false,
    success: function (returndata) {
      alert(returndata);
    }
  });
 
  return false;
});

참조 http://digipiph.com/blog/submitting-multipartform-data-using-jquery-and-ajax


저작자 표시 동일 조건 변경 허락
신고

+ Recent posts