This use case takes a given file outside of enmeshed, encrypts and uploads it to the Backbone and creates a File with the respective metadata information for the Identity to access it. The File can from now on be shared by references to other Identities. This can be the reference.truncated of the File itself, which is used, for example, when exchanging Files using Attributes, or the reference.truncated of a Token. In the latter case, the Token for the File must be created first.

Parameters

  • content is the to-be-uploaded file content as byte array.
  • filename is the name of the file from the operating system.
  • mimetype of the respective file.
  • Optionally, expiresAt can be specified, which describes the ISODateTime the File expires.
  • Optionally, a title can be provided for the File.
  • Optionally, a description can be provided for the File.
  • Optionally, tags can be provided for the File. If an IdentityAttribute with IdentityFileReference as value.@type is created for the File during transferring the ownership of the File to a peer, it will have these tags as well. For this reason, a tag is valid if it is contained in the AttributeTagCollection for the value.@type IdentityFileReference and starts with the prefix bkb: or if it starts with the custom tag prefix x: or X:, the prefix urn:, the prefix language: followed by a valid ISO 639 language code or the prefix mimetype: followed by a valid MIME type matching the pattern ^[a-z-*]+/[a-z-*]+$.

On Success

  • An encrypted File is stored on the Backbone and can be shared by its references.
  • Only the metadata of the File is stored locally.
  • If expiresAt wasn’t specified, the expiration date of the File will be set to a default value that corresponds to zero o’clock on the 31st of December, 9999.
  • If title wasn’t provided, it will be set to an empty string "" as default value.
  • The created File is returned.

On Failure

  • The parameters are malformed.
  • The file size is too big.
  • Invalid tags were provided. A tag is invalid if it is neither contained in the AttributeTagCollection for the IdentityAttribute value.@type IdentityFileReference and starts with the prefix bkb: nor starts with the custom tag prefix x: or X:, the prefix urn:, the prefix language: followed by a valid ISO 639 language code nor the prefix mimetype: followed by a valid MIME type matching the pattern ^[a-z-*]+/[a-z-*]+$.

How to execute this use case with the Connector?

The Connector is our first-class citizen, thus we provide you with a detailed API description for every use case. This use case can be executed with the REST API of the Connector which you can Access the Connector.
Corresponding interactive API docs excerpt: