Class ThirdwebStorage
- Namespace
- Thirdweb
- Assembly
- Thirdweb.dll
Provides methods for downloading and uploading data to Thirdweb storage.
public static class ThirdwebStorage
- Inheritance
-
ThirdwebStorage
- Inherited Members
Methods
Download<T>(ThirdwebClient, string, int?)
Downloads data from the specified URI.
public static Task<T> Download<T>(ThirdwebClient client, string uri, int? requestTimeout = null)
Parameters
client
ThirdwebClientThe Thirdweb client.
uri
stringThe URI to download from.
requestTimeout
int?The optional request timeout in milliseconds.
Returns
- Task<T>
The downloaded data.
Type Parameters
T
The type of data to download.
Exceptions
- ArgumentNullException
Thrown if the URI is null or empty.
- Exception
Thrown if the download fails.
Upload(ThirdwebClient, string)
Uploads a file to Thirdweb storage from the specified path.
public static Task<IPFSUploadResult> Upload(ThirdwebClient client, string path)
Parameters
client
ThirdwebClientThe Thirdweb client.
path
stringThe path to the file.
Returns
- Task<IPFSUploadResult>
The result of the upload.
Exceptions
- ArgumentNullException
Thrown if the path is null or empty.
UploadRaw(ThirdwebClient, byte[])
Uploads raw byte data to Thirdweb storage.
public static Task<IPFSUploadResult> UploadRaw(ThirdwebClient client, byte[] rawBytes)
Parameters
client
ThirdwebClientThe Thirdweb client.
rawBytes
byte[]The raw byte data to upload.
Returns
- Task<IPFSUploadResult>
The result of the upload.
Exceptions
- ArgumentNullException
Thrown if the raw byte data is null or empty.
- Exception
Thrown if the upload fails.