node.js files.upload.path is undefined
node.js files.upload.path is undefined
我正在学习节点初学者书籍,现在是最后一步。以下代码:
var form = new formidable.IncomingForm();
form.parse(request,function(error,fields,files){
fs.rename(files.upload.path,"/tmp/test.png",function(error){
if(error){
fs.unlink("/tmp/test.png");
fs.rename(files.upload.path,"/tmp/test.png");
}
});
});
终端告诉我文件。上传是未定义的-我不知道为什么-谁能告诉我?
我也有同样的问题。我修正了删除request.setEncoding("utf8")在server.js
我猜你用的是windows电脑。他的例子是在Linux上的。我通过改变路径来修复它"/Users/[USER]/AppData/Local/Temp/test.png"(在所有使用其他路径的地方)
相关文章:
- Jquery - table.row(tr) is undefined
- $routeParams is undefined
- Angular js $scope is Undefined
- Angular - $cookies is undefined
- TypeError: e is undefined - javascript
- “google.maps.MapTypeId is undefined”在FF 14中使用GMAP3时
- chrome.storage.local["mykey"] is undefined
- 回调在 Angular2/Firebase 中生成“TypeError: this is undefined”
- KendoWindow .visible(); is undefined?
- jquery: $ is undefined
- ReactDom is undefined
- TypeScript: TypeError b is undefined
- rowdata is undefined
- mozChannels/mozSampleRate is undefined
- phonegap build cordova.file is undefined
- window.jQuery.ui is undefined
- blackberry.io.dir.appDirs is undefined
- Youtube iFrame API 'YT is undefined'
- SignalR $.connection is undefined
- “window.angular is undefined.” 当使用量角器进行自动测试时