Увеличил лимиты на загрузку\скачивание файлов до 50Мб
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import {sleep} from '../share/utils';
|
import {sleep} from '../share/utils';
|
||||||
|
|
||||||
const maxFileUploadSize = 10*1024*1024;
|
const maxFileUploadSize = 50*1024*1024;
|
||||||
const api = axios.create({
|
const api = axios.create({
|
||||||
baseURL: '/api/reader'
|
baseURL: '/api/reader'
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
const got = require('got');
|
const got = require('got');
|
||||||
|
|
||||||
|
const maxDownloadSize = 50*1024*1024;
|
||||||
|
|
||||||
class FileDownloader {
|
class FileDownloader {
|
||||||
constructor() {
|
constructor() {
|
||||||
}
|
}
|
||||||
|
|
||||||
async load(url, callback) {
|
async load(url, callback) {
|
||||||
const maxDownloadSize = 10*1024*1024;
|
|
||||||
let errMes = '';
|
let errMes = '';
|
||||||
|
|
||||||
const response = await got(url, {method: 'HEAD'});
|
const response = await got(url, {method: 'HEAD'});
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ const c = require('./controllers');
|
|||||||
const utils = require('./core/utils');
|
const utils = require('./core/utils');
|
||||||
const multer = require('multer');
|
const multer = require('multer');
|
||||||
|
|
||||||
|
const maxUploadSize = 50*1024*1024;
|
||||||
|
|
||||||
function initRoutes(app, connPool, config) {
|
function initRoutes(app, connPool, config) {
|
||||||
const misc = new c.MiscController(connPool, config);
|
const misc = new c.MiscController(connPool, config);
|
||||||
const reader = new c.ReaderController(connPool, config);
|
const reader = new c.ReaderController(connPool, config);
|
||||||
@@ -20,7 +22,7 @@ function initRoutes(app, connPool, config) {
|
|||||||
cb(null, utils.randomHexString(30));
|
cb(null, utils.randomHexString(30));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
const upload = multer({ storage, limits: {fileSize: 10*1024*1024} });
|
const upload = multer({ storage, limits: {fileSize: maxUploadSize} });
|
||||||
|
|
||||||
//routes
|
//routes
|
||||||
const routes = [
|
const routes = [
|
||||||
|
|||||||
Reference in New Issue
Block a user