优化数据存储展示
This commit is contained in:
@@ -25,6 +25,7 @@ import javax.annotation.PostConstruct;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.channels.Channels;
|
||||
import java.nio.channels.ReadableByteChannel;
|
||||
@@ -447,7 +448,10 @@ public class MinioService implements IMinioService {
|
||||
String mediaType = org.apache.commons.lang3.StringUtils.isBlank(contentType) ?
|
||||
MediaType.APPLICATION_OCTET_STREAM_VALUE : contentType;
|
||||
response.setContentType(mediaType);
|
||||
response.setHeader(HttpHeaders.CONTENT_DISPOSITION, encodedFileName);
|
||||
|
||||
String encodeFileName = URLEncoder.encode(encodedFileName, "UTF-8");
|
||||
encodeFileName = encodeFileName.replaceAll("\\+", "%20");
|
||||
response.setHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment;filename=\"" + encodeFileName + "\";filename*=utf-8");
|
||||
response.setHeader(HttpHeaders.ACCEPT_RANGES, "bytes");
|
||||
response.addHeader(HttpHeaders.CONTENT_LENGTH, String.valueOf(fileSize));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user