내가, 내 백엔드 작품을 추측 실패는 각도 2 : 덩어리로 우편 번호를 다운로드하는 것은이 작품과 지퍼 미세하기 때문에
curl -X POST -H 'Content-Type: application/json' -d '{}' http://localhost:3000/zip/create > file.zip
내 장고 백엔드 반환이 같은 데이터 :
return HttpResponse(data, content_type='application/octet-stream')
ZIP이 도착하면 어떤 식 으로든 손상되어 종료 할 수 있기 때문에 Angular 2 코드에서 무엇이 잘못되었는지 알 수 없습니다. 이 우편을 다운로드하는 URL을 클릭하면
let blob = new Blob([response._body], { "type": 'application/octet-stream;' });
this.exportUrl = this.sanitizer.bypassSecurityTrustUrl(URL.createObjectURL(blob));
this.exportFileName = "download.zip";
을했지만 작동하지 않습니다
실제 데이터는 response._body
것 같다. 그래서 분명히 어떻게 든 바이너리 데이터를 잘못 처리합니까?
내 서비스는 기본적으로 이것이다 :
return this.http.post(
this.zipUrl,
JSON.stringify(zipCreationParameters),
{headers: {'Content-Type': 'application/json'} });