|
|
|
@ -90,4 +90,29 @@ public class DownloadController {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping(value = "/udiwms/donwload/printFile")
|
|
|
|
|
public void printFile(HttpServletResponse response, @RequestParam String fileName) throws IOException {
|
|
|
|
|
|
|
|
|
|
String url="D:\\udi\\udiwms\\udiwmsfile\\pdf\\template\\"+fileName;
|
|
|
|
|
OutputStream os = null;
|
|
|
|
|
try {
|
|
|
|
|
FileInputStream input = new FileInputStream(new File(url));
|
|
|
|
|
OutputStream out = response.getOutputStream();
|
|
|
|
|
byte[] b = new byte[2048];
|
|
|
|
|
int len;
|
|
|
|
|
while ((len = input.read(b)) != -1) {
|
|
|
|
|
out.write(b, 0, len);
|
|
|
|
|
}
|
|
|
|
|
input.close();
|
|
|
|
|
} catch (IOException e) {
|
|
|
|
|
|
|
|
|
|
} finally {
|
|
|
|
|
if (os != null) {
|
|
|
|
|
os.flush();
|
|
|
|
|
os.close();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|