@@ -357,15 +357,13 @@ public class ApiController {
|
|||||||
MessageCode.FILE_DOWNLOAD_ERROR.getDescription(),
|
MessageCode.FILE_DOWNLOAD_ERROR.getDescription(),
|
||||||
errorData));
|
errorData));
|
||||||
}
|
}
|
||||||
|
|
||||||
String contentType = determineContentType(filePath);
|
String contentType = determineContentType(filePath);
|
||||||
|
|
||||||
return ResponseEntity.ok()
|
return ResponseEntity.ok()
|
||||||
.contentLength(fileSize)
|
.contentLength(fileSize)
|
||||||
.contentType(MediaType.parseMediaType(contentType))
|
.contentType(MediaType.parseMediaType(contentType))
|
||||||
.header(HttpHeaders.CONTENT_DISPOSITION,
|
.header(HttpHeaders.CONTENT_DISPOSITION,
|
||||||
"attachment; filename=\"" + entityResponse.getOriginalFileName() +
|
"attachment; filename=\"" + entityResponse.getOriginalFileName() + "\"")
|
||||||
"_nocopy_protected" + "\"")
|
|
||||||
.body(resource);
|
.body(resource);
|
||||||
} catch (FileEntityNotFoundException e) {
|
} catch (FileEntityNotFoundException e) {
|
||||||
Map<String, Object> errorData = new HashMap<>();
|
Map<String, Object> errorData = new HashMap<>();
|
||||||
|
|||||||
@@ -389,7 +389,9 @@ public class FileEntityService {
|
|||||||
.existsOnDisk(existsOnDisk)
|
.existsOnDisk(existsOnDisk)
|
||||||
.supportId(fileEntity.getSupportId())
|
.supportId(fileEntity.getSupportId())
|
||||||
.protectStatus(fileEntity.getProtectionStatus().toString())
|
.protectStatus(fileEntity.getProtectionStatus().toString())
|
||||||
.fileName(fileEntity.getOriginalFileName())
|
.fileName(fileEntity.getOriginalFileName().replace("." +
|
||||||
|
fileEntity.getFileExtension(), "") + "_nocopy_protected" +
|
||||||
|
fileEntity.getFileExtension())
|
||||||
.ownerName(user.getFullName())
|
.ownerName(user.getFullName())
|
||||||
.ownerEmail(user.getEmail())
|
.ownerEmail(user.getEmail())
|
||||||
.ownerCompany(user.getCompanyName())
|
.ownerCompany(user.getCompanyName())
|
||||||
|
|||||||
Reference in New Issue
Block a user