Skip to content

Commit

Permalink
Merge pull request #843 from Prinzhorn/patch-1
Browse files Browse the repository at this point in the history
Fix Content-Disposition usage in docs
  • Loading branch information
dr-dimitru authored Jun 29, 2022
2 parents 5992438 + d865790 commit d705d8f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion docs/gridfs-bucket-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,10 @@ export const createInterceptDownload = bucket =>
});

http.response.setHeader('Cache-Control', this.cacheControl);
http.response.setHeader('Content-Disposition', `inline; filename="${file.name}"`);

const dispositionName = "filename=\"" + (encodeURIComponent(file.name)) + "\"; filename=*UTF-8\"" + (encodeURIComponent(file.name)) + "\"; ";
const dispositionEncoding = 'charset=utf-8';
http.response.setHeader('Content-Disposition', dispositionType + dispositionName + dispositionEncoding);
}
return Boolean(gridFsFileId); // Serve file from either GridFS or FS if it wasn't uploaded yet
}
Expand Down

0 comments on commit d705d8f

Please sign in to comment.