main
黄海 2 years ago
parent c1cc9b0082
commit 8af9bffe4a

@ -829,13 +829,12 @@ public class CollectController extends Controller {
byte[] buf = new byte[1024];
int len;
response.reset(); // 非常重要
URL u = new URL("file:///" + excelPath);
URL u = new URL("file:///" + pdfPath);
response.setContentType(u.openConnection().getContentType());
String fileName = pdf_filename;
response.setHeader("Content-Disposition", "inline; filename=" + fileName);
OutputStream out = response.getOutputStream();
while ((len = br.read(buf)) > 0)
out.write(buf, 0, len);
while ((len = br.read(buf)) > 0) out.write(buf, 0, len);
br.close();
out.close();
renderNull();

Loading…
Cancel
Save