<img width="100%" height="100%" @dblclick="uploadPersonImg()"
:src="['per/perbaseinfo/getFileInputStream?fileName='+userImg]" />
/**
* 获取FTP文件文件流
* @param fileId
* @return
*/
@RequestMapping("/getFileInputStream")
public ResponseEntity<byte[]> getFileInputStream(String fileName, HttpServletRequest request,
HttpServletResponse response) {
try {
// 临时
ByteArrayOutputStream os = new ByteArrayOutputStream();
FTPUtile.getOutputstreamFromFtp(fileName, os);
InputStream inputStream = null;
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_OCTET_STREAM);
headers.setContentDispositionFormData("attachment", "file");
return new ResponseEntity<byte[]>(os.toByteArray(), HttpStatus.OK);
} catch (Exception e) {
e.printStackTrace();
return null;
}
}