百度编辑器拦截上传图片提交上传腾讯服务器并返回腾讯url
2015-08-13 10:31
387 查看
微信图文编辑时图片必须为上传到腾讯服务器的url,外连接全部屏蔽,则需要修改百度编辑器的源码,源码具体处理地方如下图,类为BinaryUploader.java
InputStream is = fileStream.openStream();
State storageState = StorageManager.saveFileByInputStream(is,physicalPath, maxSize);
is.close();
if (storageState.isSuccess()) {
//TODO 处理上传腾讯服务器
String headurl=PropUtil.getPropertyValue("wx.sz.get.web.url","http://localhost:8080").replace("\"","");
String url =UploadToTX.uploadToTX(physicalPath, headurl+PathFormat.format(savePath));
storageState.putInfo("url", url);
storageState.putInfo("type", suffix);
storageState.putInfo("original", originFileName + suffix);
}
return storageState;
InputStream is = fileStream.openStream();
State storageState = StorageManager.saveFileByInputStream(is,physicalPath, maxSize);
is.close();
if (storageState.isSuccess()) {
//TODO 处理上传腾讯服务器
String headurl=PropUtil.getPropertyValue("wx.sz.get.web.url","http://localhost:8080").replace("\"","");
String url =UploadToTX.uploadToTX(physicalPath, headurl+PathFormat.format(savePath));
storageState.putInfo("url", url);
storageState.putInfo("type", suffix);
storageState.putInfo("original", originFileName + suffix);
}
return storageState;
相关文章推荐
- 浅谈手机app测试注意点
- 划分子网的意义
- APP 通过 HAL 层访问硬件
- 操作数据(insert、update、delete)
- 浅谈手机app测试注意点
- 图像的局部特征(对比全局特征)
- 【工作笔记0008】easyui中datagrid绑定到table的翻页注意事项
- k-means原理
- 九度 Online Judge 算法 刷题 题目1022:游船出租
- Hibernate学习英文文档翻译 4.3.11 1.教程
- ZOJ 2100 seeding 【DFS】
- 深入解析Oracle学习笔记(第六章)
- 关于Linux 网络编程bind()和connect()的理解
- Sum It Up POJ 1564 HDU 杭电1258【DFS】
- [WinForm]DataGridView列头右键菜单
- SaltStack Syndic配置
- 系统默认Select框 知多少
- WKWebView的新特性与使用
- TypeScript入门
- 8月9日28家中国域名商六类国际域名注册保有量统计