Storage

bucket.file.geUploadUrl()

Create a upload url for a file within a bucket.

using Nitric.Sdk;
using Nitric.Sdk.Storage;

var assets = Nitric.Bucket('assets').With(BucketPermission.Writing);

var logo = assets.File('images/logo.png');

// Create a read-only signed url reference for uploading
var uploadUrl = logo.GetUploadUrl();

Nitric.Run();

Parameters


expiry int

Seconds until link expiry. Defaults to 600, Maximum of 604800 (7 days)


Examples

using Nitric.Sdk;
using Nitric.Sdk.Storage;

var assets = Nitric.Bucket('assets').With(BucketPermission.Writing);

var logo = assets.File('images/logo.png');

// Create a read-only signed url reference for uploading
var downloadUrl = logo.GetUploadUrl(300);

Nitric.Run();