The C# .NET SDK currently only supports legacy versions of Nitric prior to v1. This version is maintained for compatibility with existing projects and not recommended for new projects. New projects should be started using a supported SDK (presented automatically using the `nitric new` command) orget in touch to request an update to the latest version.
.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 of604800
(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();