diff options
author | Joram Wilander <jwawilander@gmail.com> | 2015-12-15 09:54:16 -0500 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2015-12-15 09:54:16 -0500 |
commit | ba149bd971a5111808a7aaa6478c8de885b9f6ae (patch) | |
tree | 678de9f42fda34dad016c9812ca27db8cfb03cf2 /web/react/components | |
parent | 2980a56370dfe150952beeb97c25e5e21e7fc7e5 (diff) | |
parent | 76e1f1f6138de9cfea03847af0eff61a10261043 (diff) | |
download | chat-ba149bd971a5111808a7aaa6478c8de885b9f6ae.tar.gz chat-ba149bd971a5111808a7aaa6478c8de885b9f6ae.tar.bz2 chat-ba149bd971a5111808a7aaa6478c8de885b9f6ae.zip |
Merge pull request #1729 from hmhealey/plt886
PLT-886 Add additional max file size checks
Diffstat (limited to 'web/react/components')
-rw-r--r-- | web/react/components/user_settings/user_settings_general.jsx | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/web/react/components/user_settings/user_settings_general.jsx b/web/react/components/user_settings/user_settings_general.jsx index 7c1a1297f..014038dd4 100644 --- a/web/react/components/user_settings/user_settings_general.jsx +++ b/web/react/components/user_settings/user_settings_general.jsx @@ -9,6 +9,7 @@ import UserStore from '../../stores/user_store.jsx'; import ErrorStore from '../../stores/error_store.jsx'; import * as Client from '../../utils/client.jsx'; +import Constants from '../../utils/constants.jsx'; import * as AsyncClient from '../../utils/async_client.jsx'; import * as Utils from '../../utils/utils.jsx'; @@ -156,6 +157,9 @@ export default class UserSettingsGeneralTab extends React.Component { if (picture.type !== 'image/jpeg' && picture.type !== 'image/png') { this.setState({clientError: 'Only JPG or PNG images may be used for profile pictures.'}); return; + } else if (picture.size > Constants.MAX_FILE_SIZE) { + this.setState({clientError: 'Unable to upload profile image. File is too large.'}); + return; } var formData = new FormData(); |