-
Notifications
You must be signed in to change notification settings - Fork 825
Closed
Description
文件下载经过Edge网关后,报错提示content-type not supported,不走网关是可以的。
错误提示:
{
"message": "method GET, path /netdisk/file_download/, statusCode 200, reasonPhrase OK, response content-type application/octet-stream is not supported"
}
接口代码:
@ApiResponses({
@apiresponse(code = 200, response = File.class, message = "")
})
@GetMapping(value = "/file_download")
public ResponseEntity fileDownload(InvocationContext ic , FileDownloadReq req) {
String fileName = req.getFileName();
String fileStr = super.doFileDownload(OutApiServerEnum.TY_HUI_JIAO_YUN.getValue(), ic, fileName);
return ResponseEntity
.ok().header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_OCTET_STREAM_VALUE)
.header(HttpHeaders.CONTENT_DISPOSITION, "attachment;filename="+fileName)
.body(new ByteArrayInputStream(fileStr.getBytes()));
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels