yusueketk 7 년 전
부모
커밋
6d8efa300f
2개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 1
      src/client/js/components/PageEditor.js
  2. 1 1
      src/server/routes/attachment.js

+ 1 - 1
src/client/js/components/PageEditor.js

@@ -119,7 +119,7 @@ export default class PageEditor extends React.Component {
    */
   async onUpload(file) {
     const res  = await this.props.crowi.apiGet('/attachments.limit', {_csrf: this.props.crowi.csrfToken});
-    if (file.size > res.usableCapacity) {
+    if (res.usableCapacity && file.size > res.usableCapacity) {
       toastr.error(undefined, 'MongoDB for uploading files reaches limit', {
         closeButton: true,
         progressBar: true,

+ 1 - 1
src/server/routes/attachment.js

@@ -113,7 +113,7 @@ module.exports = function(crowi, app) {
    */
   api.limit = async function(req, res) {
     if (process.env.FILE_UPLOAD !== 'mongodb') {
-      return res.json(ApiResponse.success({usableCapacity: Infinity}));
+      return res.json(ApiResponse.success({usableCapacity: null}));
     }
     else {
       const usingFilesSize = await fileUploader.getCollectionSize();