Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/files/domain/models/FileTypeToFriendlyTypeMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ const MimeTypeDisplay: Record<string, string> = {
'application/photoshop': 'Photoshop Image',
'image/vnd.adobe.photoshop': 'Photoshop Image',
'application/x-photoshop': 'Photoshop Image',
'image/webp': 'WebP Image',
// Audio
'audio/x-aiff': 'AIFF Audio',
'audio/mp3': 'MP3 Audio',
Expand Down
6 changes: 4 additions & 2 deletions src/files/infrastructure/mappers/UploadedFileDTOMapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ export class UploadedFileDTOMapper {
storageId: string,
checksumValue: string,
checksumType: FixityAlgorithm,
fileType: string
fileType: string,
forceReplace?: boolean
): UploadedFileDTO {
return {
fileName: fileName,
Expand All @@ -22,7 +23,8 @@ export class UploadedFileDTOMapper {
storageId: storageId,
checksumValue: checksumValue,
checksumType: checksumType,
mimeType: fileType === '' ? 'application/octet-stream' : fileType // some browsers (e.g., chromium for .java files) fail to detect the mime type for some files and leave the fileType as an empty string, we use the default value 'application/octet-stream' in that case
mimeType: fileType === '' ? 'application/octet-stream' : fileType, // some browsers (e.g., chromium for .java files) fail to detect the mime type for some files and leave the fileType as an empty string, we use the default value 'application/octet-stream' in that case,
...(forceReplace && { forceReplace: true })
}
}
}
3 changes: 2 additions & 1 deletion src/sections/shared/file-uploader/useReplaceFile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ export const useReplaceFile = (fileRepository: FileRepository): UseReplaceFileRe
newFileInfo.storageId,
newFileInfo.checksumValue,
newFileInfo.checksumAlgorithm,
newFileInfo.fileType
newFileInfo.fileType,
true
)

try {
Expand Down
Loading