Update error message when uploading too large images (#4535)
Этот коммит содержится в:
коммит произвёл
Christopher Speller
родитель
e4f46124b0
Коммит
526c392aad
@@ -171,7 +171,7 @@ func doUploadFile(teamId string, channelId string, userId string, rawFilename st
|
|||||||
if info.IsImage() {
|
if info.IsImage() {
|
||||||
// Check dimensions before loading the whole thing into memory later on
|
// Check dimensions before loading the whole thing into memory later on
|
||||||
if info.Width*info.Height > MaxImageSize {
|
if info.Width*info.Height > MaxImageSize {
|
||||||
err := model.NewLocAppError("uploadFile", "api.file.upload_file.large_image.app_error", nil, "")
|
err := model.NewLocAppError("uploadFile", "api.file.upload_file.large_image.app_error", map[string]interface{}{"Filename": filename}, "")
|
||||||
err.StatusCode = http.StatusBadRequest
|
err.StatusCode = http.StatusBadRequest
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -983,7 +983,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "api.file.upload_file.large_image.app_error",
|
"id": "api.file.upload_file.large_image.app_error",
|
||||||
"translation": "Unable to upload image file. File is too large."
|
"translation": "File above maximum dimensions could not be uploaded: {{.Filename}}"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "api.file.upload_file.storage.app_error",
|
"id": "api.file.upload_file.storage.app_error",
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user