0
這個問題後:僅當條件得到驗證時纔可以加載模塊嗎?
Formidable and form not multipart but with method post (perhaps an issue of sincronicity)
我覈實,如果我插入這樣的代碼:
app.use(function (request, response, cb) {
var type="form";
if(request!=undefined && request.headers!=undefined && request.headers['content-type']!=undefined) {
type=request.headers['content-type'];
if(type.startsWith("multipart"))
{
console.log("Load formidable");
formidable();
}
cb();
});
應用程序打印「負載強大」,但request.fields是空的,也堆跟蹤不報告強大的正確負載! 有人遇到類似的問題,並找到解決辦法?
P.S .:我也嘗試將此代碼外部化,但沒有任何改變。