I'm working through the node beginner book and I'm at the final step. At this code:
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");
}
});
});
terminal tells me that files.upload is undefined - I'm not sure why - can anyone tell me?
i have same issue too. I fixed by delete request.setEncoding("utf8") on server.js