.NET - 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

  • Name
    expiry
    Optional
    Optional
    Type
    int
    Description

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

Examples

Create a temporary file upload link for a user

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();