您的位置:首页 > 其它

百度编辑器拦截上传图片提交上传腾讯server并返回腾讯url

2017-05-13 09:29 423 查看
微信图文编辑时图片必须为上传到腾讯server的url,外连接所有屏蔽,则须要改动百度编辑器的源代码,源代码详细处理地方例如以下图。类为BinaryUploader.java

InputStream is = fileStream.openStream();

State storageState = StorageManager.saveFileByInputStream(is,physicalPath, maxSize);

is.close();

if (storageState.isSuccess()) {

//TODO 处理上传腾讯server

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;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: