我已成功配置了環回的存儲組件,即loopback-component-storage。我已經能夠創建文件夾。但是,當我嘗試上傳文件(使用郵遞員),它不斷給請求停止錯誤:環回組件存儲文件上傳請求中止formidable lib incoming_form.js
error: Error: Request aborted
at IncomingMessage.<anonymous> (E:\projects\TestProject\node_modules\formidable\lib\incoming_form.js:120:19)
at emitNone (events.js:86:13)
at IncomingMessage.emit (events.js:185:7)
at abortIncoming (_http_server.js:283:11)
at TLSSocket.serverSocketCloseListener (_http_server.js:296:5)
at emitOne (events.js:101:20)
at TLSSocket.emit (events.js:188:7)
at _handle.close (net.js:498:12)
at Socket.done (_tls_wrap.js:325:7)
at Socket.g (events.js:291:16)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at TCP._handle.close [as _onclose] (net.js:498:12)
我也配置了SSL,那麼該URL是https://localhost/api/containers/container1/upload。這可能是一個問題嗎?我在我的package.json中使用了以下模塊。
"dependencies": {
"body-parser": "^1.17.1",
"compression": "^1.6.2",
"cors": "^2.8.1",
"express": "^4.15.2",
"helmet": "^3.4.1",
"js2xmlparser": "^3.0.0",
"loopback": "^3.4.0",
"loopback-boot": "^2.23.0",
"loopback-component-explorer": "^4.1.1",
"loopback-component-storage": "^3.2.0",
"loopback-connector-rest": "^2.1.0",
"loopback-datasource-juggler": "^3.2.0",
"loopback-ssl": "0.0.9",
"multer": "^1.3.0",
"strong-error-handler": "^2.1.0",
"winston": "^2.3.1"
}
的server.js文件看起來象下面這樣:
'use strict';
var loopback = require('loopback');
var boot = require('loopback-boot');
var loopbackSSL = require('loopback-ssl');
var bodyParser = require('body-parser');
var multer = require('multer');
var app = module.exports = loopback();
app.use(bodyParser.text());
app.start = function() {
// start the web server
return app.listen(function() {
app.emit('started');
var baseUrl = app.get('url').replace(/\/$/, '');
console.log('Web server listening at: %s', baseUrl);
if (app.get('loopback-component-explorer')) {
var explorerPath = app.get('loopback-component-explorer').mountPath;
console.log('Browse your REST API at %s%s', baseUrl, explorerPath);
}
});
};
// Bootstrap the application, configure models, datasources and middleware.
// Sub-apps like REST API are mounted via boot scripts.
boot(app, __dirname, function (err) {
if (err) throw err;
if (require.main === module)
return loopbackSSL.startServer(app);
});
可以在任何上述模塊的是一個問題?看起來這是一個節點強大的問題。任何人都可以讓我知道嗎?我們可以編寫一個遠程方法來接受文件嗎?
您是否授予您創建的這些文件夾的權限? – itssajan
是的權限在那裏。 –