Skip to content

Commit

Permalink
solved
Browse files Browse the repository at this point in the history
  • Loading branch information
miolane committed May 14, 2019
1 parent 46c30f3 commit 3455ad1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
6 changes: 1 addition & 5 deletions app/file-upload/server/methods/sendFileMessage.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import _ from 'underscore';
import { Uploads } from '../../../models';
import { callbacks } from '../../../callbacks';
import { FileUpload } from '../lib/FileUpload';
import { settings } from '../../../settings';

Meteor.methods({
async sendFileMessage(roomId, store, file, msgData = {}) {
Expand All @@ -31,10 +30,7 @@ Meteor.methods({

Uploads.updateFileComplete(file._id, Meteor.userId(), _.omit(file, '_id'));

const siteUrl = settings.get('Site_Url');
const prefix = siteUrl.replace(/http(s)?:\/\/[a-z]*(\.[a-z]*)*(:[0-9]*)?/g, '');

const fileUrl = `${ prefix }/file-upload/${ file._id }/${ encodeURI(file.name) }`;
const fileUrl = `/file-upload/${ file._id }/${ encodeURI(file.name) }`;

const attachment = {
title: file.name,
Expand Down
2 changes: 1 addition & 1 deletion app/message-attachments/client/messageAttachment.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
{{#if title_link}}
<a href="{{title_link}}" target="_blank" rel="noopener noreferrer">{{title}}</a>
{{#if title_link_download}}
<a class="attachment-download-icon rc-tooltip" aria-label="{{_ 'Download'}}" href="{{title_link}}" target="_blank" download="" rel="noopener noreferrer">{{> icon icon="download"}}</a>
<a class="attachment-download-icon rc-tooltip" aria-label="{{_ 'Download'}}" href="{{ getURL title_link}}" target="_blank" download="" rel="noopener noreferrer">{{> icon icon="download"}}</a>
{{/if}}
{{else}}
{{title}}
Expand Down
2 changes: 1 addition & 1 deletion app/ui-flextab/client/tabs/uploadedFilesList.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ Template.uploadedFilesList.events({
name: t('Download'),
action: () => {
const a = document.createElement('a');
a.href = this.file.url;
a.href = getURL(this.file.url);
a.download = this.file.name;
document.body.appendChild(a);
a.click();
Expand Down

0 comments on commit 3455ad1

Please sign in to comment.