File storage
Corvis does not have a file storage layer with interchangeable drivers (local disk, S3 or other services) behind a single API.
Alternative
What does exist covers the case of saving and serving files on disk:
- Receiving files:
FileInterceptorand the other interceptors incorvis::multeracceptmultipart/form-data. Withdisk_storage(DiskStorageOptions::new().destination(..).filename(..))each file is written to disk, and withmemory_storage()it stays in memory. For another destination (a bucket, for example), implement theStorageEnginetrait (handle_fileandremove_file). See File upload and streaming. - Sending files:
StreamableFile::from_path("report.pdf").await?reads the file in chunks and returns it from a handler. - Serving a folder:
corvis::serve_static(root)orServeStaticModule::for_root(...)(see Static files).