//上传项目附件
publicString uploadProjectAttachs() throws Exception {if (attachment.length() >MAX_SIZE) {
return null;}
String pathStr= DocPathProperties.getValue("NewProjectPath");
String timeStr=DateUtil.getNow(DateUtil.FORMAT_FULL_STR);
File path= newFile(pathStr);//如果当前的路径目录不存在就创建一个目录。
if (!path.exists()) {
path.mkdirs();
}
BufferedInputStream bis= new BufferedInputStream(newFileInputStream(attachment));
String suffix= attachmentFileName.substring(attachmentFileName.indexOf("."));
File file= new File(path + "/" + timeStr +suffix);
BufferedOutputStream bos= new BufferedOutputStream(newFileOutputStream(file));int length = 0;byte[] buffered = new byte[2048];while (-1 != (length = (bis.read(buffered, 0, buffered.length)))) {
bos.write(bu