2016-10-21 27 views
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 .:我也嘗試將此代碼外部化,但沒有任何改變。

回答

0

嗯,我解決了從快遞到快遞的問題! 我不會接受這個答案,因爲我知道如果同樣的事情可能與快遞,但我會告訴未來好奇我如何解決這個問題。

相關問題