diff --git a/app/utils/server/functions/normalizeMessageFileUpload.js b/app/utils/server/functions/normalizeMessageFileUpload.js index 77be075e9774..cfe540b95830 100644 --- a/app/utils/server/functions/normalizeMessageFileUpload.js +++ b/app/utils/server/functions/normalizeMessageFileUpload.js @@ -1,6 +1,7 @@ +import { Meteor } from 'meteor/meteor'; + import { FileUpload } from '../../../file-upload/server'; import { Uploads } from '../../../models/server'; -import { settings } from '../../../settings/server'; export const normalizeMessageFileUpload = (message) => { if (message.file && !message.fileUpload) { @@ -10,7 +11,7 @@ export const normalizeMessageFileUpload = (message) => { return message; } message.fileUpload = { - publicFilePath: `${ settings.get('Site_Url') }${ FileUpload.getPath(`${ file._id }/${ encodeURI(file.name) }`).substring(1) }${ jwt ? `?token=${ jwt }` : '' }`, + publicFilePath: Meteor.absoluteUrl(`${ FileUpload.getPath(`${ file._id }/${ encodeURI(file.name) }`).substring(1) }${ jwt ? `?token=${ jwt }` : '' }`), type: file.type, size: file.size, };