PLT-1316/PLT-3280 Change client-side max file size limit (#3354)
* Change client-side max file size limit It now relies on the value set in config.json. Re-enable and tweak the max file size setting in system console. * Update file upload error message
Этот коммит содержится в:
коммит произвёл
Harrison Healey
родитель
71bd413b25
Коммит
f4dd8e5796
@@ -22,8 +22,8 @@ export default class StorageSettings extends AdminSettings {
|
||||
|
||||
this.renderSettings = this.renderSettings.bind(this);
|
||||
|
||||
//maxFileSize: props.config.FileSettings.MaxFileSize,
|
||||
this.state = Object.assign(this.state, {
|
||||
maxFileSize: props.config.FileSettings.MaxFileSize / 1024 / 1024,
|
||||
driverName: props.config.FileSettings.DriverName,
|
||||
directory: props.config.FileSettings.Directory,
|
||||
amazonS3AccessKeyId: props.config.FileSettings.AmazonS3AccessKeyId,
|
||||
@@ -34,7 +34,7 @@ export default class StorageSettings extends AdminSettings {
|
||||
}
|
||||
|
||||
getConfigFromState(config) {
|
||||
//config.FileSettings.MaxFileSize = this.parseInt(this.state.maxFileSize);
|
||||
config.FileSettings.MaxFileSize = this.parseInt(this.state.maxFileSize) * 1024 * 1024;
|
||||
config.FileSettings.DriverName = this.state.driverName;
|
||||
config.FileSettings.Directory = this.state.directory;
|
||||
config.FileSettings.AmazonS3AccessKeyId = this.state.amazonS3AccessKeyId;
|
||||
@@ -57,25 +57,6 @@ export default class StorageSettings extends AdminSettings {
|
||||
}
|
||||
|
||||
renderSettings() {
|
||||
/*<TextSetting
|
||||
id='maxFileSize'
|
||||
label={
|
||||
<FormattedMessage
|
||||
id='admin.image.maxFileSizeTitle'
|
||||
defaultMessage='Max File Size:'
|
||||
/>
|
||||
}
|
||||
placeholder={Utils.localizeMessage('admin.image.maxFileSizeExample', 'Ex "52428800"')}
|
||||
helpText={
|
||||
<FormattedMessage
|
||||
id='admin.image.maxFileSizeDescription'
|
||||
defaultMessage='Max File Size in bytes. If blank, will be set to 52428800 (50MB).'
|
||||
/>
|
||||
}
|
||||
value={this.state.maxFileSize}
|
||||
onChange={this.handleChange}
|
||||
/>*/
|
||||
|
||||
return (
|
||||
<SettingsGroup>
|
||||
<DropdownSetting
|
||||
@@ -196,6 +177,24 @@ export default class StorageSettings extends AdminSettings {
|
||||
onChange={this.handleChange}
|
||||
disabled={this.state.driverName !== DRIVER_S3}
|
||||
/>
|
||||
<TextSetting
|
||||
id='maxFileSize'
|
||||
label={
|
||||
<FormattedMessage
|
||||
id='admin.image.maxFileSizeTitle'
|
||||
defaultMessage='Maximum File Size:'
|
||||
/>
|
||||
}
|
||||
placeholder={Utils.localizeMessage('admin.image.maxFileSizeExample', '50')}
|
||||
helpText={
|
||||
<FormattedMessage
|
||||
id='admin.image.maxFileSizeDescription'
|
||||
defaultMessage='Maximum file size for message attachments in megabytes. Caution: Verify server memory can support your setting choice. Large file sizes increase the risk of server crashes and failed uploads due to network interruptions.'
|
||||
/>
|
||||
}
|
||||
value={this.state.maxFileSize}
|
||||
onChange={this.handleChange}
|
||||
/>
|
||||
</SettingsGroup>
|
||||
);
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user