[MM-48523] Expose resumable uploads API to plugins (#21700)

* Expose resumable uploads API to plugins

* Update translations
Этот коммит содержится в:
Claudio Costa
2022-11-22 15:26:22 -06:00
коммит произвёл GitHub
родитель a1e16f7b02
Коммит 0509e78744
13 изменённых файлов: 362 добавлений и 19 удалений

Просмотреть файл

@@ -65,6 +65,13 @@ func createUpload(c *Context, w http.ResponseWriter, r *http.Request) {
if c.AppContext.Session().UserId != "" {
us.UserId = c.AppContext.Session().UserId
}
if us.FileSize > *c.App.Config().FileSettings.MaxFileSize {
c.Err = model.NewAppError("createUpload", "api.upload.create.upload_too_large.app_error",
map[string]any{"channelId": us.ChannelId}, "", http.StatusRequestEntityTooLarge)
return
}
rus, err := c.App.CreateUploadSession(c.AppContext, &us)
if err != nil {
c.Err = err