解析服务器文件大小限制为20MB

时间:2016-12-23 03:40:17

标签: ios ssh filesize parse-server

有谁知道如何更改解析服务器的文件大小限制?目前我可以正常下载和上传文件到20MB,但我需要更大一些。

GitHub上有链接

https://github.com/ParsePlatform/parse-server/blob/master/src/Routers/FilesRouter.js#L21

但我无法弄清楚如何在服务器端更改此功能。通过SSH探索项目的每个部分,无法看到fielsrouter.js

编辑: server.js文件现在包含变量maxUploadSize

var express = require('express');
var ParseServer = require('parse-server').ParseServer;
var app = express();
// Specify the connection string for your mongodb database
// and the location to your Parse cloud code
var api = new ParseServer({
    databaseURI: "XXXXX",
    cloud: "XXXXX",
    appId: “XXXXX”,
    masterKey: “XXXXX”,
    fileKey: “XXXXX”,
    serverURL: ‘XXXXX’,
    maxUploadSize: = '50mb'
});
// Serve the Parse API on the /parse URL prefix
app.use('/parse', api);

var port = 1337;
app.listen(port, function() {
    console.log('parse-server running on port ' + port);
});

//Parse Dashboard
var ParseDashboard = require('parse-dashboard');
var dashboard = new ParseDashboard({
    apps: [
        {
            appName: “XXXXX”,
            appId: “XXXXX”,
            masterKey: “XXXXX”,
            fileKey: “XXXXX”,
            production: true,
            serverURL: ‘XXXXX’,
           // maxUploadSize: = '50mb'
        }
    ]
});

var allowInsecureHTTP = true;

// Serve the Parse Dashboard on the /parsedashboard URL prefix
app.use('/', dashboard);

var portdash = 4040;
app.listen(portdash, function() {
    console.log('parse-dashboard running on port ' + portdash);
});

1 个答案:

答案 0 :(得分:0)

您可以将maxUploadSize设置为您需要的任何内容。

https://github.com/ParsePlatform/parse-server/blob/ab06055369efee1e456dfdf5c3a86ceba0f4faf1/src/ParseServer.js

但我建议您也检查一下nginx client_max_body_size

更新

Bitnami配置

编辑/opt/bitnami/apps/parse/htdocs/server.js文件并插入凭据

然后重启

   sudo /opt/bitnami/ctlscript.sh restart parse