无法下载交易附件

问题描述 投票:1回答:1

我无法通过以下网址使用以下网址下载附件:不同的Corda节点/端口,但是我能够在早期版本的Corda中下载相同的内容,即在Corda的13版以下。

http://localhost:10007/attachments/2A094563FBC6091F1E84D82EEDB48E6DB5F125E753Fhttp://localhost:10010/attachments/2A094563FBC6091F1E84D82EEDB48E6DB5F125E753Fhttp://localhost:10013/attachments/2A094563FBC6091F1E84D82EEDB48E6DB5F125E753F

[corda 14.0版中是否对此进行了任何更改以下载附件。 ??

注意:-我的交易正在与具有附件的3个方共享,但无法从所有节点/ URL下载附件。

请帮助,在此先感谢...

corda
1个回答
0
投票

Dan Newton最近在Corda附件上发表了博客文章。

他概述了如何在Kotlin中使用代码来完成它

private val proxy: CordaRPCOps = rpc.proxy

@GetMapping("/{hash}")
fun downloadByHash(@PathVariable hash: String): ResponseEntity<Resource> {
  val inputStream = InputStreamResource(proxy.openAttachment(SecureHash.parse(hash)))
  return ResponseEntity.ok().header(
    HttpHeaders.CONTENT_DISPOSITION,
    "attachment; filename=\"$hash.zip\""
  ).body(inputStream)
}

他还概述了如果有Corda附件ID,如何通过HTTP进行操作。

您可以在此处找到完整的帖子:https://medium.com/corda/uploading-and-downloading-attachments-in-corda-7104a1e974c1

© www.soinside.com 2019 - 2024. All rights reserved.