mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
Changed post drafts to maintain a store a unique id for each file upload to fix issues with duplicate file names
This commit is contained in:
@@ -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()))
|
||||
|
||||
Reference in New Issue
Block a user