w*s 发帖数: 7227 | 1 Error: (node) warning: Recursive process.nextTick detected. This will break
in the next version of node. Please use setImmediate for recursive deferral.
at maxTickWarn
一大堆这个,
基本就是
https://github.com/joyent/node/issues/6065
问题是我的multer是1.0的版本了,大家碰到过吗? | l**********n 发帖数: 8443 | | w*s 发帖数: 7227 | 3 sorry was cooking food, taking care of kids ...
thank you so much !
/*Define dependencies.*/
var express = require('express');
var multer = require('multer');
var app=express();
var done=false;
var exec = require('child_process').exec;
var cmd = 'echo ';
/*Configure the multer.*/
//var istarUpload = app.use(multer({ dest: './uploads/'}).single('myUpload')
);
var istarUpload = app.use(multer({ dest: './uploads/',
rename: function (fieldname, filename) {
return filename+Date.now();
},
onFileUploadStart: function (file) {
console.log(file.originalname + ' is starting ...')
cmd = 'echo "Download starting ..." >> mylog';
exec(cmd, function(error, stdout, stderr) {
// command output is in stdout
});
},
onFileUploadComplete: function (file) {
console.log(file.fieldname + ' uploaded to ' + file.path)
done=true;
cmd = 'echo "Download finished ..." >> mylog';
exec(cmd, function(error, stdout, stderr) {
// command output is in stdout
});
}
}).single('myUpload'));
/*Handling routes.*/
app.get('/',function(req,res){
res.sendfile("multer.html");
});
app.post('/uploads', istarUpload, function(req,res){
console.log(req.file);
//res.redirect('/');
if(done==true){
console.log(req.files);
res.end("File uploaded.");
}
});
/*Run the server.*/
app.listen(7779,function(){
console.log("Working on port 7779");
});
【在 l**********n 的大作中提到】 : 你把你的代码贴上来,看看是什么造成的?
| w*s 发帖数: 7227 | 4 node 0.10.29
express 3.4.8
multer 1.0.1
i do see file gets uploaded successfully, same size, can open the jpg file .
..
but not sure uploadCompleteed get caught, because of too many such warnings
... | l**********n 发帖数: 8443 | 5 I see no reason you have to use child_process in the onFileUploadStart
handler. | w*s 发帖数: 7227 | 6 was practicing other things ...
【在 l**********n 的大作中提到】 : I see no reason you have to use child_process in the onFileUploadStart : handler.
| n*****t 发帖数: 22014 | 7 onFileUploadStart return false to stop upload
好像老版本是有一个 cb,查查看
【在 w*s 的大作中提到】 : was practicing other things ...
| w*s 发帖数: 7227 | 8 我那程序抄的是旧版本的例子,现在好了,谢谢!
【在 n*****t 的大作中提到】 : onFileUploadStart return false to stop upload : 好像老版本是有一个 cb,查查看
| l**********n 发帖数: 8443 | 9 用IDE写程序,有时就是这样。有时候不思考,就抄过来了。
【在 w*s 的大作中提到】 : 我那程序抄的是旧版本的例子,现在好了,谢谢!
|
|