diff options
author | Christopher Speller <crspeller@gmail.com> | 2016-01-22 08:14:18 -0500 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2016-01-22 08:14:18 -0500 |
commit | 9937e1ead2d75c52101dd0ab04b97c074f87232a (patch) | |
tree | 7f0489548a18aac9e81c287a8ea3dac269044195 /web/react/utils/utils.jsx | |
parent | 43098bc1df9fc73bd36e75c54b38f7edeb86d7ff (diff) | |
parent | 261b38be45420b45f97842ec55247ea7b47a527e (diff) | |
download | chat-9937e1ead2d75c52101dd0ab04b97c074f87232a.tar.gz chat-9937e1ead2d75c52101dd0ab04b97c074f87232a.tar.bz2 chat-9937e1ead2d75c52101dd0ab04b97c074f87232a.zip |
Merge pull request #1948 from hmhealey/plt1652
PLT-1652 Added download param to getFile api call
Diffstat (limited to 'web/react/utils/utils.jsx')
-rw-r--r-- | web/react/utils/utils.jsx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx index 71fd0852b..1b31adf69 100644 --- a/web/react/utils/utils.jsx +++ b/web/react/utils/utils.jsx @@ -1091,8 +1091,9 @@ export function fileSizeToString(bytes) { } // Converts a filename (like those attached to Post objects) to a url that can be used to retrieve attachments from the server. -export function getFileUrl(filename) { - return getWindowLocationOrigin() + '/api/v1/files/get' + filename + '?' + getSessionIndex(); +export function getFileUrl(filename, isDownload) { + const downloadParam = isDownload ? '&download=1' : ''; + return getWindowLocationOrigin() + '/api/v1/files/get' + filename + '?' + getSessionIndex() + downloadParam; } // Gets the name of a file (including extension) from a given url or file path. |