Skip to main content

ResQ.Storage.UploadResult

UploadResult(string, string, long, string, bool, DateTimeOffset) Constructor

Represents the result of a file upload operation to IPFS.
public UploadResult(string Cid, string FileName, long SizeBytes, string ContentType, bool IsPinned, System.DateTimeOffset Timestamp);

Parameters

Cid System.String The IPFS Content Identifier (CID) for the uploaded file. FileName System.String The original filename of the uploaded content. SizeBytes System.Int64 The size of the file in bytes. ContentType System.String The MIME type of the file (e.g., “image/jpeg”, “video/mp4”). IsPinned System.Boolean True if the file has been pinned to ensure persistence. Timestamp System.DateTimeOffset UTC timestamp when the upload completed.

Example

var result = await storageClient.UploadAsync(stream, "evidence.jpg", "image/jpeg");
Console.WriteLine($"Uploaded to: {result.Cid}");
Console.WriteLine($"Size: {result.SizeBytes} bytes");
Console.WriteLine($"URL: {storageClient.GetGatewayUrl(result.Cid)}");

Remarks

This record contains all relevant information about an uploaded file, including its Content Identifier (CID), metadata, and pin status. The CID is the permanent address of the file on the IPFS network.