From 50fc6e1e9e8d286fd6a406cef75e48a28f9427ad Mon Sep 17 00:00:00 2001 From: George Goldberg Date: Fri, 25 Aug 2017 15:38:13 +0100 Subject: PLT-???? Prepare file upload infrastructure for Data Retention. (#7266) * Prepare file upload infrastructure for Data Retention. This commit prepares the file upload infrastructure for the data retention feature that is under construction. Changes are: * Move file management code to utils to allow access to it from jobs. * From now on, store all file uploads in a top level folder which is the date of the day on which they were uploaded. This commit is based on Harrison Healey's branch, but updated to work with the latest master. * Use NewAppError --- app/slackimport.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app/slackimport.go') diff --git a/app/slackimport.go b/app/slackimport.go index 4470b8323..e57a3a3d1 100644 --- a/app/slackimport.go +++ b/app/slackimport.go @@ -401,7 +401,8 @@ func SlackUploadFile(sPost SlackPost, uploads map[string]*zip.File, teamId strin } defer openFile.Close() - uploadedFile, err := OldImportFile(openFile, teamId, channelId, userId, filepath.Base(file.Name)) + timestamp := utils.TimeFromMillis(SlackConvertTimeStamp(sPost.TimeStamp)) + uploadedFile, err := OldImportFile(timestamp, openFile, teamId, channelId, userId, filepath.Base(file.Name)) if err != nil { l4g.Warn(utils.T("api.slackimport.slack_add_posts.upload_file_upload_failed.warn", map[string]interface{}{"FileId": sPost.File.Id, "Error": err.Error()})) return nil, false -- cgit v1.2.3-1-g7c22