mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-14 06:11:16 +00:00
check file size before upload file via upload link
This commit is contained in:
@@ -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">
|
||||
|
@@ -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>
|
||||
|
Reference in New Issue
Block a user