메뉴얼 다운로드 오류 수정

main
이범준 3 months ago
parent 245e81e14b
commit e4a678159e

@ -13,6 +13,7 @@ import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.function.Consumer;
import java.util.regex.Matcher;
import javax.annotation.Resource;
@ -54,6 +55,7 @@ import cokr.xit.fims.crdn.dao.CrdnInfoMapper;
import cokr.xit.fims.crdn.service.CrdnService;
import cokr.xit.fims.sprt.Sprt;
import cokr.xit.fims.sprt.service.bean.MediaBean;
import cokr.xit.foundation.Downloadable;
import cokr.xit.foundation.data.DataObject;
@Controller
@ -298,10 +300,26 @@ public class FileController extends cokr.xit.base.file.web.FileController {
}
InputStream menualIS = cps.getInputStream();
mav.addObject("file", menualIS);
mav.addObject("filename", "과태료통합관리시스템_메뉴얼"+"("+"v"+menualVersion+")"+".pptx");
mav.addObject("contentType", "application/vnd.openxmlformats-officedocument.presentationml.presentation");
mav.addObject("length", menualIS.available());
byte[] menualBytes = menualIS.readAllBytes();
menualIS.close();
Consumer<OutputStream> writer = new Consumer<OutputStream>() {
@Override
public void accept(OutputStream os) {
try {
os.write(menualBytes);
} catch (IOException e) {
e.printStackTrace();
}
}
};
mav.addObject("download",
new Downloadable()
.setContentType("application/vnd.openxmlformats-officedocument.presentationml.presentation")
.setWriter(writer)
.setFilename("과태료통합관리시스템_메뉴얼"+"("+"v"+menualVersion+")"+".pptx")
);
return mav;
}

Loading…
Cancel
Save