From 2b9c447fe470f9e08ccd18d174ee04fca8fa77cb Mon Sep 17 00:00:00 2001 From: Prateek Jain Date: Thu, 30 Apr 2020 23:50:29 +0530 Subject: [PATCH] [FIX] Allow special chars in Filename (#2020) * fixed-filename-issue * improve Co-authored-by: Djorkaeff Alexandre Co-authored-by: Diego Mello --- app/lib/methods/sendFileMessage.js | 2 +- app/views/AttachmentView.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/lib/methods/sendFileMessage.js b/app/lib/methods/sendFileMessage.js index b5a85c4c..041b1f40 100644 --- a/app/lib/methods/sendFileMessage.js +++ b/app/lib/methods/sendFileMessage.js @@ -62,7 +62,7 @@ export function sendFileMessage(rid, fileInfo, tmid, server, user) { formData.append('file', { uri: fileInfo.path, type: fileInfo.type, - name: fileInfo.name || 'fileMessage' + name: encodeURI(fileInfo.name) || 'fileMessage' }); if (fileInfo.description) { diff --git a/app/views/AttachmentView.js b/app/views/AttachmentView.js index c94a8e84..9f23833e 100644 --- a/app/views/AttachmentView.js +++ b/app/views/AttachmentView.js @@ -35,7 +35,7 @@ class AttachmentView extends React.Component { const handleSave = navigation.getParam('handleSave', () => {}); const { title } = attachment; const options = { - title, + title: decodeURI(title), ...themedHeader(theme), headerRight: };