summaryrefslogtreecommitdiffstats
path: root/app/file.go
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2017-10-04 11:42:38 -0400
committerGitHub <noreply@github.com>2017-10-04 11:42:38 -0400
commitfadd9514f6e71590aba781a7035e1de4150137b0 (patch)
treea265d44f377281abd56baf31fe878e08f90f7d4b /app/file.go
parentfa80cb10a8ad047f9504c49ed2671d31650d1878 (diff)
downloadchat-fadd9514f6e71590aba781a7035e1de4150137b0.tar.gz
chat-fadd9514f6e71590aba781a7035e1de4150137b0.tar.bz2
chat-fadd9514f6e71590aba781a7035e1de4150137b0.zip
PLT-7718 Patch for files (#7564)
* Patch for files * Fix merge * Fix tests * Fix another test
Diffstat (limited to 'app/file.go')
-rw-r--r--app/file.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/file.go b/app/file.go
index 36a23e3d8..2beb7231a 100644
--- a/app/file.go
+++ b/app/file.go
@@ -291,8 +291,11 @@ func (a *App) UploadFiles(teamId string, channelId string, userId string, fileHe
return resStruct, nil
}
-func (a *App) DoUploadFile(now time.Time, teamId string, channelId string, userId string, rawFilename string, data []byte) (*model.FileInfo, *model.AppError) {
+func (a *App) DoUploadFile(now time.Time, rawTeamId string, rawChannelId string, rawUserId string, rawFilename string, data []byte) (*model.FileInfo, *model.AppError) {
filename := filepath.Base(rawFilename)
+ teamId := filepath.Base(rawTeamId)
+ channelId := filepath.Base(rawChannelId)
+ userId := filepath.Base(rawUserId)
info, err := model.GetInfoForBytes(filename, data)
if err != nil {