Skip to content
Snippets Groups Projects
Commit 8ecaa784 authored by Giuseppe Digilio's avatar Giuseppe Digilio
Browse files

Added comment

parent 786579e1
No related branches found
No related tags found
No related merge requests found
......@@ -37,6 +37,8 @@ export class FileService {
* http DSpaceRESTV2Response
*/
getFileNameFromResponseContentDisposition(res: DSpaceRESTV2Response) {
// NOTE: to be able to retrieve 'Content-Disposition' header,
// you need to set 'Access-Control-Expose-Headers': 'Content-Disposition' ON SERVER SIDE
const contentDisposition = res.headers.get('content-disposition') || '';
const matches = /filename="([^;]+)"/ig.exec(contentDisposition) || [];
return (matches[1] || 'untitled').trim().replace(/\.[^/.]+$/, '');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment