由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - node.js multer: Recursive process.nextTick detected
相关主题
nodejs multer file upload后如何管理此文件,不跟以前的冲突?Python有什么好的方法建two-way pipe?
A question related to pipenode.js child process: 怎样保证1个命令执行完了再执行下一个?
问一个vc++ 2008的问题请教一个python下面popen的问题
how can I get external program's result in CPyCharm里的Python启动的Process在等待按键,如何继续
菜鸟请教个hadoop streaming job 的问题 (转载)complexity of a recursive
50伪币:请教perl代码差错的问题!多谢啦!不要小看js
请高人解释一下为啥这个输出总是"HELLO-ERR"reverse LL recursively
一个 perl 的 print 的初级问题[合集] 问个递归的问题
相关话题的讨论汇总
话题: multer话题: recursive话题: detected话题: var话题: function
进入Programming版参与讨论
1 (共1页)
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
2
你把你的代码贴上来,看看是什么造成的?
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 的大作中提到】
: 我那程序抄的是旧版本的例子,现在好了,谢谢!
1 (共1页)
进入Programming版参与讨论
相关主题
[合集] 问个递归的问题菜鸟请教个hadoop streaming job 的问题 (转载)
Python: What does this mean?50伪币:请教perl代码差错的问题!多谢啦!
recurvion真的很难懂~~请高人解释一下为啥这个输出总是"HELLO-ERR"
树的前序遍历一个 perl 的 print 的初级问题
nodejs multer file upload后如何管理此文件,不跟以前的冲突?Python有什么好的方法建two-way pipe?
A question related to pipenode.js child process: 怎样保证1个命令执行完了再执行下一个?
问一个vc++ 2008的问题请教一个python下面popen的问题
how can I get external program's result in CPyCharm里的Python启动的Process在等待按键,如何继续
相关话题的讨论汇总
话题: multer话题: recursive话题: detected话题: var话题: function