active-storage 0.1.1

Active Storage facilitates uploading files to a cloud storage
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use std::path::PathBuf;

use active_storage::{drivers, StoreConfig};

#[tokio::main]
async fn main() {
    let config = drivers::disk::Config {
        location: PathBuf::from("tmp"),
    };
    let disk_driver = StoreConfig::Disk(config).build().await.unwrap();

    let file_path = PathBuf::from("test.txt");
    disk_driver
        .write(file_path.as_path(), "my content")
        .await
        .unwrap();
}