您的位置:首页 > 其它

百度编辑器拦截上传图片提交上传腾讯服务器并返回腾讯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;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: