@RequestMapping("/underwriting/imgUpload1.shtml")
public void underwritingImgUpload1(@RequestParam("images") MultipartFile file, HttpServletResponse response) {
try {
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
// 创建一个长度为100的byte数组
byte[] buff = new byte[100];
int rc = 0;
// 获取BLOB数据对象的二进制流
InputStream binaryStream = file.getInputStream();
while ((rc = binaryStream.read(buff, 0, 100)) > 0) {
byteArrayOutputStream.write(buff, 0, rc);
}
byte[] byteArray = byteArrayOutputStream.toByteArray();
String con = new String(byteArray, "ISO-8859-1");
Map result = productUnderWritingService.underwritingImgUpload(con);
HtmlUtil.writerJson(response, result);
} catch (Exception e) {
e.printStackTrace();
}
}