Docs

ThirdwebStorage

The ThirdwebStorage class provides methods to interact with any URL including IPFS, allowing you to download and upload data easily.

Download

Download data from an HTTP or IPFS URI.

var data = await ThirdwebStorage.Download<string>(client, "{{uri}}");

Upload

Upload data to IPFS and pin it.

var result = await ThirdwebStorage.Upload(client, "{{path/to-file}}");

Example Usage

Downloading JSON Data

var jsonData = await ThirdwebStorage.Download<Dictionary<string, object>>(client, "ipfs://Qm...");

Uploading a File

var uploadResult = await ThirdwebStorage.Upload(client, @"C:\path\to\your\file.txt");
Console.WriteLine($"IPFS Hash: {uploadResult.IpfsHash}");

This adaptation provides a concise guide on using the .NET SDK for IPFS storage operations, covering both downloading and uploading functionalities. The approach in the .NET SDK is more aligned with general .NET practices, making it suitable for a variety of applications beyond Unity.