← All BaaS products
File Storage

FileServer

Kanject.FileServer

Secure, scalable file storage — declarative resource servers, source-generated upload methods and signed upload URLs, S3-backed, deployed into your own AWS.

RESOURCE SERVERS · declared, source-generated
[ResourceServer]Public
ItemResourceServer
item-images
.jpg · .png · .webp4 MB × 10
SHA-256WebP
[ResourceServer]Public
ProfileResourceServer
profile
.jpg · .png · .webp2 MB
[ResourceServer]Private
ShippingLabelResourceServer
shipping-labels
.jpg · .png · .pdf200 KB
UPLOAD · routed to ItemResourceServer · Public · /item-images · max 4 MB × 10
sneaker-side.jpg
2.4 MB · JPG · item-images/itm_8f3a/
Public
STORED · PUBLIC URL
ItemResourceServer · sneaker-side.webp
Public · owner-scoped
GET200 · 248ms
resource-iditm_8f3a
content-typeimage/webp · 1.1 MB
content-hashsha-256 · 9c3e7a…
validationpassed
6
CAPABILITIES
YOUR ACCOUNT
NATIVE C#
LAMBDA OR CONTAINER

Built for files of every shape and size.

01

Declarative resource servers

A partial class with [ResourceServer], [AcceptedFileTypes] and [FileUploadSettings] sets where files live, the types it takes, and its size and count caps.

[ResourceServer]
02

Generated methods

Each server gets typed upload, replace and list-by-owner methods named after the class. Override one only when you need a hook.

UploadItemAsync()
03

Direct-to-S3 uploads

Add [SignedUrlUpload] and the server hands out a signed upload URL instead, so the bytes go straight to your bucket. A finalize call moves them into place.

GenerateItemUploadUrlAsync()
04

Content validation

Opt in with [FileValidation]: magic-byte checks, JPEG EXIF stripping, SVG sanitising, and rejecting PDF JavaScript or Office macros. Or plug in your own validator.

IFileContentValidator
05

Scoped to an owner

Files sit in a Public or Private location. Every lookup is keyed by the owner’s id, and a delete checks the owner first.

StorageLocation.Private
06

Lifecycle expiration

Switch expiry on and stored files are deleted after the days you set, with incomplete multipart uploads swept too. No infrastructure change.

EnableLifecycleExpiration
Lambda or container

Inside your service.
On Lambda or in any container.

FileServer is a .NET library, not a service you call. Add the package, register it in Program.cs, and it runs inside your own service, in process. Ship that service as a Lambda function or as your own container on ECS, EKS or App Runner — the module goes wherever your code goes.

  • ✓ In process: your code calls the module directly — no sidecar, no extra network hop
  • ✓ Built from your code: your image or Lambda package, patched on your schedule
  • ✓ Configured in Program.cs, with values from your own settings
One NuGet install. Zero glue code.

Kanject.FileServer ships into your AWS, registers itself with one line in Program.cs, and exposes a typed API the rest of your service can use immediately.

Read the deployment guide →
Ready to ship?

Simplify your cloud
journey today.

Join forward-thinking developers and businesses who trust Kanject to eliminate cloud complexity and accelerate innovation.