Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

我的ueditor图片无法上传,但是没报错,请问怎么回事呢 #36

Closed
yanqic opened this issue Apr 1, 2017 · 2 comments
Closed

Comments

@yanqic
Copy link

yanqic commented Apr 1, 2017

app.use("/edit/ue", ueditor(path.join(__dirname, 'public'), function (req, res, next) {
//客户端上传文件设置
var imgDir = '/public/upload/';
var ActionType = req.query.action;
if (ActionType === 'uploadimage' || ActionType === 'uploadfile' || ActionType === 'uploadvideo') {
var file_url = imgDir;//默认图片上传地址
/其他上传格式的地址/
if (ActionType === 'uploadfile') {
file_url = '/file/ueditor/'; //附件
}
if (ActionType === 'uploadvideo') {
file_url = '/video/ueditor/'; //视频
}
res.ue_up(file_url); //你只要输入要保存的地址 。保存操作交给ueditor来做
res.setHeader('Content-Type', 'text/html');
}
// 客户端发起图片列表请求
else if (req.query.action === 'listimage') {
var dir_url = imgDir;
res.ue_list(dir_url); // 客户端会列出 dir_url 目录下的所有图片
}
// 客户端发起其它请求
else {
res.setHeader('Content-Type', 'application/json');
res.redirect('/public/ueditor/nodejs/config.json');
}
}));

@yanqic yanqic changed the title 我的netpi图片无法上传,但是没报错,请问怎么回事呢 我的ueditor图片无法上传,但是没报错,请问怎么回事呢 Apr 1, 2017
@netpi
Copy link
Owner

netpi commented Apr 1, 2017

@yanqi321 你打开客户端 看看客户端请求报什么错

@yanqic
Copy link
Author

yanqic commented Apr 6, 2017

谢谢了,是图片传到其他路径里面了,尴尬

@netpi netpi closed this as completed Apr 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants