Skip to main content

Storage

DownloadImage

Download an image from a URL or IPFS URI into a Sprite object.

var data = await sdk.storage.DownloadImage("{{image_url}}");
Configuration

imageUri

An IPFS URI or a URL that points to an image.

Must be a string.

Return Value

Returns a Sprite.

DownloadText

Download text data such as JSON from a URL or IPFS URI.

var data = await sdk.storage.DownloadText<string>("{{text_uri}}");
Configuration

Data type (generic type)

The type of data to return. Any type that can be deserialized with JsonConvert.DeserializeObject.

textUri

An IPFS URI or a URL that points to data.

Must be a string.

Return Value

Returns the data as the specified type.

UploadFromPath

Upload and pin data in IPFS using the path to a file.

var data = await sdk.storage.UploadFromPath("{{path/to-file}}");
Configuration

path

The path to the file to upload.

Must be a string.

UploadText

Upload raw data to IPFS.

var data = await sdk.storage.UploadText("Hello world!");
Configuration

text

The text to upload.

Must be a string.