May I know why Corda only supports zip/jar attachment?

(Jiachuan Li) #1


I am new to Corda and I found that in Corda’s documentation, it said the attachment should be .zip/.jar, I think there must be a reason why Corda work like this, so does anyone know the reason? Thanks in advance.

(Richard Green) #2

The file format for .jar and .zip are very similar - but we chose to use an archive format so that multiple files of any type can be included in one attachment as opposed to having one attachment per physical file. Obviously there is nothing wrong with having one file per attachment archive uploaded, but we believe this gives us more flexibility.

(Jiachuan Li) #3

Thanks Richard for your reply, but things will become inconvenient if I only need to upload one document with another type of extension name, this is not doable by uploading this un-zipped file directly to Corda, am I correct? So do we plan to accept uploading one un-zipped file in the future? Thanks.

(Richard Green) #4

AFAIK, there is nothing in the roadmap right now to allow just single files to be uploaded instead of a zip file, as it almost detracts from the functionality right now. However saying that, I think we can probably extend the API such that the usage is more suited for you, but as this isn’t under “missing functionality” I can’t guarantee how long before we have to add that. Always happy to accept pull requests though if you want to make the additons or changes yourself though !

(Charles) #5

Nothing prevents your app from doing the zipping itself once presented by a single file thus shielding the user from the inconvenience , probably better approach than waiting :slight_smile:

(Jiachuan Li) #6

This is a good point, we can still allow user uploading unzip single file or multiple files and zip it via program code before send it to corda to process:slight_smile:

(aswink) #7

Hey Jiachuan, Charlesand RIchard Green
we worked on the attachement-demo from Git, baby steps but still made progress.
What we are confused right now is …

  1. How is the document stored - are you storing it on the H2-BlockCHain(B.C) or just the hash reference.
  2. How to pick up the document from another location(assuming we are not keeping documents on BC)and attach the same on to another flow else where?

(Jiachuan Li) #8

Hi Aswink

Our project stored the document into H2 database and I think that is current approach Corda provide, each stored document has one hash code and it can be used for a state to associate one document to one state. I am not sure what is your second point, could you please provide more details about the scenario/process for it? Thanks.