|
发表于 2018-12-26 08:58:40
|
显示全部楼层
代码实现的是要在B上调用A上的文件下载,然后在B上做上传,java操作的是服务器本地的文件
action在B上实现,A在调用B的action的时候把A上下载的地址传给B
java中调用附件的url参考java中是DocUtils中提供了getDocUrl(String docPath,String urlPattern,boolean isFormSubmit)
- Table table = KSQL.select("select tp.fName,tp.fCode,tp.fAttachmentPicture as fTP from AP_FJTP tp limit 1,0", null, "/appdemo/test/data", null);
- Iterator<Row> it = table.iterator();
- String url = "";
- Row r = it.next();
- String v = r.getString("fTP");// 取出图片字段
- if (!Utils.isEmptyString(v)) {
- JSONArray ja = JSONArray.parseArray(v);
- JSONObject jsonObject = ja.getJSONObject(0);
- String docPath = jsonObject.getString("docPath");
- String fileID = jsonObject.getString("fileID");
- String urlPattern = "/repository/file/download/" + fileID + "/last/content";
- url = addBsessionid(DocUtils.getDocUrl(docPath, urlPattern)); // 通过docPath和fileID获得图片的url
- }
复制代码
|
|