1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-13 22:01:06 +00:00

check file size before upload file via upload link

This commit is contained in:
lian
2022-06-22 12:32:20 +08:00
parent d41a024499
commit 3d0cb41de9
2 changed files with 3 additions and 2 deletions

View File

@@ -1,5 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';
import { Utils } from '../../utils/utils';
import { gettext, maxUploadFileSize } from '../../utils/constants';
const propTypes = {
@@ -10,7 +11,7 @@ class ForbidUploadListItem extends React.Component {
render() {
let { file } = this.props;
let msg = gettext('Please upload files less than {placeholder}M').replace('{placeholder}', maxUploadFileSize);
let msg = gettext('Please upload files less than {placeholder}').replace('{placeholder}', Utils.bytesToSize(maxUploadFileSize * 1000 * 1000));
return (
<tr className="file-upload-item">
<td className="upload-name">

View File

@@ -49,7 +49,7 @@ class SharedUploadLink extends React.Component {
<Fragment>
<ol className="small text-gray">
<li className="tip-list-item">{gettext('Folder upload is limited to Chrome, Firefox 50+, and Microsoft Edge.')}</li>
{maxUploadFileSize && <li className="tip-list-item">{gettext('File size should be smaller than {max_size_placeholder}M.').replace('{max_size_placeholder}', maxUploadFileSize)}</li>}
{maxUploadFileSize && <li className="tip-list-item">{gettext('File size should be smaller than {max_size_placeholder}.').replace('{max_size_placeholder}', Utils.bytesToSize(maxUploadFileSize * 1000 * 1000))}</li>}
</ol>
<div id="upload-link-drop-zone" className="text-center mt-2 mb-4">
<span className="sf3-font sf3-font-upload upload-icon"></span>