File Upload

Before uploading files, you need to buy storage space, please refer to Purchase Space

```rust
use cess_rust_sdk::chain::{ChainSdk, file::File};


// The account mnemonic that will be used to sign transactions.
const MNEMONIC: &str = "dragon pool symptom mandate ill expand sibling feature inhale melt envelope essay";

const BUCKET_NAME: &str = "Bucket_For_Docs";

#[tokio::main]
async fn main() {
    let sdk = ChainSdk::new(MNEMONIC, "service_name");

    let result = sdk.store_file("README.md", BUCKET_NAME).await;
    match result {
        Ok(r) => {
            println!("File upload successful: {:?}", r);
        }
        Err(e) => {
            println!("File upload failed: {:?}", e);
        }
    }
}

```

Last updated