diff options
author | hmhealey <harrisonmhealey@gmail.com> | 2016-01-21 13:55:47 -0500 |
---|---|---|
committer | hmhealey <harrisonmhealey@gmail.com> | 2016-01-21 13:55:47 -0500 |
commit | 261b38be45420b45f97842ec55247ea7b47a527e (patch) | |
tree | c4cc8ed77bc6e0d60c80676c5e59a3821b576e11 /web/react/utils | |
parent | 302f210d66fd0850852aa2e636df14509688ee18 (diff) | |
download | chat-261b38be45420b45f97842ec55247ea7b47a527e.tar.gz chat-261b38be45420b45f97842ec55247ea7b47a527e.tar.bz2 chat-261b38be45420b45f97842ec55247ea7b47a527e.zip |
Added download param to getFile api call
Diffstat (limited to 'web/react/utils')
-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. |