图像保存得当,但它们的大小为零字节,请帮我。
以下是代码:
$(function() {
$(document).on('click', '#submitId', function() {
var zip = new JSZip();
var file = $('#pan')[0].files[0];
zip.file($('#pan')[0].files[0].name, getBase64(file), {
base64 : true
});
zip.generateAsync({
type : "blob"
}).then(function(content) {
var fd = new FormData();
fd.append('file1', content);
$.ajax({
type : 'POST',
url : 'URL',
data : fd,
processData : false,
contentType : false
}).done(function(data) {
console.log(data);
});
});
});
});