Merge pull request #1948 from hmhealey/plt1652

PLT-1652 Added download param to getFile api call
Этот коммит содержится в:
Christopher Speller
2016-01-22 08:14:18 -05:00
родитель 43098bc1df 261b38be45
Коммит 9937e1ead2
3 изменённых файлов: 16 добавлений и 11 удалений

Просмотреть файл

@@ -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.