我正在使用Node的强大模块进行表单处理。工作完美。现在,我需要访问文件上载开始之前发布的非文件字段名称/值。字段名称/值仅在文件上载完成后可用。有没有办法在文件上传开始之前获取字段名称?
formProcess = new formidable.IncomingForm();
...
formProcess.parse(req, function(error, myFields, myFiles) {
//I get access to the field values here...
//But only after the files are uploaded.
//I need this info before the file uploads start.
}
..
formProcess.on('progress', function(alreadyReceived, expectedToRcv) {
//Fileupload progress info available here...
//I need field names here while processing the upload progress.
//Application specific requirement...
}
这是否与http post方法的工作原理有关,还是特定于Node的Formidable模块的实现?