Skip to content

Commit

Permalink
nextcloud standard
Browse files Browse the repository at this point in the history
  • Loading branch information
Alfagun74 committed Sep 12, 2023
1 parent 8e8e38a commit 2fa1823
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/modules/files/files.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -477,10 +477,11 @@ export class FilesService implements OnApplicationBootstrap {
);
const type = mime.getType(fileDownloadPath);

const encodedFilename = encodeURIComponent(
fileDownloadPath.replace(/^.*[\\/]/, ""),
);
const headers = {
disposition: `attachment; filename="${encodeURIComponent(
fileDownloadPath.replace(/^.*[\\/]/, ""),
)}"`,
disposition: `attachment; filename*=UTF-8''${encodedFilename}; filename="${encodedFilename}"`,
length: statSync(fileDownloadPath).size,
type,
};
Expand Down

0 comments on commit 2fa1823

Please sign in to comment.