summaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2015-08-11 12:08:08 -0400
committerChristopher Speller <crspeller@gmail.com>2015-08-11 12:08:08 -0400
commit4c7cdb20f074e2c06a08cd64a57060b8e8b64d2e (patch)
treefd5e1948bc5f24cd8711a7a6681b142745228025 /api
parentd72d356cbcb027df8b2fcd3c84e26b64119e6b5c (diff)
parent17b05f705f910429ece1ca6c64ec56bf89dd014b (diff)
downloadchat-4c7cdb20f074e2c06a08cd64a57060b8e8b64d2e.tar.gz
chat-4c7cdb20f074e2c06a08cd64a57060b8e8b64d2e.tar.bz2
chat-4c7cdb20f074e2c06a08cd64a57060b8e8b64d2e.zip
Merge pull request #359 from hmhealey/mm1770
MM-1770 Add the ability to cancel in-progress file uploads
Diffstat (limited to 'api')
-rw-r--r--api/file.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/api/file.go b/api/file.go
index bf1c59422..558f9357e 100644
--- a/api/file.go
+++ b/api/file.go
@@ -71,7 +71,9 @@ func uploadFile(c *Context, w http.ResponseWriter, r *http.Request) {
files := m.File["files"]
resStruct := &model.FileUploadResponse{
- Filenames: []string{}}
+ Filenames: []string{},
+ ClientIds: []string{},
+ }
imageNameList := []string{}
imageDataList := [][]byte{}
@@ -113,6 +115,10 @@ func uploadFile(c *Context, w http.ResponseWriter, r *http.Request) {
resStruct.Filenames = append(resStruct.Filenames, fileUrl)
}
+ for _, clientId := range props["client_ids"] {
+ resStruct.ClientIds = append(resStruct.ClientIds, clientId)
+ }
+
fireAndForgetHandleImages(imageNameList, imageDataList, c.Session.TeamId, channelId, c.Session.UserId)
w.Write([]byte(resStruct.ToJson()))