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()
Create a new bucket for storing and retrieving files.
using Nitric.Sdk;
using Nitric.Sdk.Storage;
var assets = Nitric.Bucket("assets").With(BucketPermission.Reading, BucketPermission.Writing, BucketPermission.Deleting);
Nitric.Run();
Parameters
- Name
name
- Required
- Required
- Type
- string
- Description
The unique name of this bucket within the app. Subsequent calls to
Bucket
with the same name will return the same object.
Access
All Nitric resources provide access permissions you can use to specify the level of access your code needs to the resource. See here for details Access Control documentation.
Available permissions:
BucketPermission.Reading
This permission allows your function to read files from the bucket
BucketPermission.Writing
This permission allows your function to write files to the bucket
BucketPermission.Deleting
This permission allows your function to delete files from the bucket
Working with files
See the following for examples on working with files in a bucket: