ueditor 异步上传图片
来源:互联网 发布:linux dd u盘加载驱动 编辑:程序博客网 时间:2024/06/03 01:58
ueditor 目前异步上传图片是不能用的,可以根据ueditor.all.js源码看到里面嵌套了一层iframe ,里面的代码是这样的:
wrapper.innerHTML = '<form id="edui_form_' + timestrap + '" target="edui_iframe_' + timestrap + '" method="POST" enctype="multipart/form-data" action="' + me.getOpt('serverUrl') + '" ' + 'style="' + btnStyle + '">' + '<input id="edui_input_' + timestrap + '" type="file" accept="image/*" name="' + me.options.imageFieldName + '" ' + 'style="' + btnStyle + '">' + '</form>' + '<iframe id="edui_iframe_' + timestrap + '" name="edui_iframe_' + timestrap + '" style="display:none;width:0;height:0;border:0;margin:0;padding:0;position:absolute;"></iframe>';
后面会进行form submit,跨域不能用。
解决这个问题,我是这样处理的,通过nginx 进行代理:nginx.conf主要配置如下:
upstream sitweb { server 172.25.2.101:4000; #前端项目地址172.25.2.101是本机ip }upstream ueditor { server localhost:9119; #图片上传服务} server { listen 8086; server_name localhost; #charset koi8-r;charset utf-8; #access_log logs/host.access.log main;#location / {# root html;# index index.html index.htm;# }location / {proxy_pass http://sitweb/;proxy_set_header Host $host;proxy_set_header X-Real-IP $remote_addr;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;}location /nonsecservice/ {proxy_redirect off;proxy_set_header Host $host;proxy_set_header X-Real-IP $remote_addr;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;proxy_pass http://ueditor/nonsecservice/;}
后端服务处理修改了源码,图片上传到zimg服务器。源码地址:https://github.com/YangDiA/yangdi-ueditor-server
阅读全文
0 0
- ueditor 异步上传图片
- Ueditor JSP 图片上传
- UEditor上传图片错误
- uEditor独立图片上传
- ueditor图片上传配置
- UEditor图片上传
- Ueditor 图片上传配置
- Ueditor 图片自定义上传
- ueditor 上传图片错误
- UEditor 图片上传
- UEditor上传图片配置
- UEditor 图片视频上传
- UEditor 上传图片到七牛
- 百度ueditor踩坑,ueditor图片上传
- ueditor struts2上传图片问题
- 百度UEditor上传图片配置
- struts2 ueditor 上传图片失败
- ueditor单独调用图片上传
- 大型网站数据库优化及浅析大型网站的架构(转)
- FileOutputStream介绍和具体用法
- linux-教案-环境准备
- Leture 16
- Apache httpd 2.4.27开启GZIP压缩功能
- ueditor 异步上传图片
- JAVA 关于web页面下载导出Excel通用方法
- Java-猜拳游戏
- Linux定时任务Crontab命令详解
- CodeBlocks 配色方案设置
- MapReduce功能实现五---去重(Distinct)、计数(Count)
- PerfectDisk Pro 14汉化中文版
- php工具方法
- Codewars算法题(5)