Added serverside file size check for post attachments
Этот коммит содержится в:
@@ -76,6 +76,12 @@ func uploadFile(c *Context, w http.ResponseWriter, r *http.Request) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if r.ContentLength > model.MAX_FILE_SIZE {
|
||||||
|
c.Err = model.NewAppError("uploadFile", "Unable to upload file. File is too large.", "")
|
||||||
|
c.Err.StatusCode = http.StatusRequestEntityTooLarge
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
err := r.ParseMultipartForm(model.MAX_FILE_SIZE)
|
err := r.ParseMultipartForm(model.MAX_FILE_SIZE)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||||
|
|||||||
@@ -162,7 +162,6 @@ export default class UserSettingsGeneralTab extends React.Component {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var formData = new FormData();
|
var formData = new FormData();
|
||||||
formData.append('image', picture, picture.name);
|
formData.append('image', picture, picture.name);
|
||||||
this.setState({loadingPicture: true});
|
this.setState({loadingPicture: true});
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user