손상다운로드 zip 파일은 내가 사용자가이 코드를 사용하여 서버에서 zip 파일을 다운로드 할 수 있도록하기 위해 노력하고있어
$.ajax({
url: 'url-to-the-method/get-shape-file',
type: 'GET',
success: function(shape) {
console.log(shape);
var a = document.createElement('a');
a.href = 'data:attachment/zip,' + shape;
a.target = '_blank';
a.download = 'exported-shape-file.zip';
document.body.appendChild(a);
a.click();
},
error: function(data) {
Message.error("Could not download shapefile");
}
});
을하지만, 손상된 파일을 다운로드. 크기가 더 커야하며, 또한 아카이브 관리자에서 파일을 열려고 할 때 다음 메시지가 표시됩니다. zipinfo :/home/tengiz/Downloads/exported-shape-file (1) .zip 중 하나에서 zipfile 디렉토리를 찾을 수 없습니다. 또는 /home/tengiz/Downloads/exported-shape-file (1) .zip.zip이며/home/tengiz/Downloads/exported-shape-file (1) .zip.ZIP, period를 찾을 수 없습니다.
여기 @BalusC으로 답변을 참조하십시오/questions/3855465/java-servlet-problem-with-corrupt-file-download? rq = 1 – mttdbrd