|
@@ -73,6 +73,7 @@ import org.springblade.resource.vo.NewBladeFile;
|
|
|
import org.springblade.system.cache.ParamCache;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.redis.core.StringRedisTemplate;
|
|
|
+import org.springframework.http.ContentDisposition;
|
|
|
import org.springframework.http.HttpHeaders;
|
|
|
import org.springframework.http.MediaType;
|
|
|
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
|
@@ -94,6 +95,7 @@ import java.io.*;
|
|
|
import java.net.URL;
|
|
|
import java.net.URLConnection;
|
|
|
import java.net.URLEncoder;
|
|
|
+import java.nio.charset.StandardCharsets;
|
|
|
import java.nio.file.Files;
|
|
|
import java.nio.file.Path;
|
|
|
import java.nio.file.StandardCopyOption;
|
|
@@ -2065,8 +2067,9 @@ public class ExcelTabController extends BladeController {
|
|
|
byte[] buffer = IoUtil.readToByteArray(redio);
|
|
|
OutputStream toClient = new BufferedOutputStream(response.getOutputStream());
|
|
|
response.setContentType("application/pdf");
|
|
|
- response.setCharacterEncoding(org.apache.commons.codec.Charsets.UTF_8.name());
|
|
|
- response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".pdf");
|
|
|
+ response.setCharacterEncoding("UTF-8");
|
|
|
+ fileName = fileName.replaceAll("/", "_").replaceAll("\\\\", "_");
|
|
|
+ response.setHeader("Content-disposition", "attachment;filename=" + URLEncoder.encode(fileName,"UTF-8") + ".pdf");
|
|
|
toClient.write(buffer);
|
|
|
toClient.flush();
|
|
|
toClient.close();
|