fix for cyrillic file name (#204)

This commit is contained in:
Denis Ezhov 2020-04-17 17:56:59 +03:00 committed by GitHub
parent 132d9b818c
commit fba331d92e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -25,7 +25,12 @@ export class FilesService {
}
getFileInfo(fileID: string): Observable<FileData> {
return this.filesService.getFileInfo(genXRequestID(), fileID);
return this.filesService.getFileInfo(genXRequestID(), fileID).pipe(
map(file => ({
...file,
fileName: decodeURI(file.fileName)
}))
);
}
downloadFile(fileID: string): Observable<FileDownload> {
@ -35,7 +40,7 @@ export class FilesService {
private uploadFileToUrl(file: File, url: string): Observable<any> {
return this.http.put(url, file, {
headers: {
'Content-Disposition': `attachment;filename=${file.name}`,
'Content-Disposition': `attachment;filename=${encodeURI(file.name)}`,
'Content-Type': ''
}
});