Crates.io | fexon |
lib.rs | fexon |
version | |
source | src |
created_at | 2024-11-23 09:17:19.189534 |
updated_at | 2024-11-29 07:38:41.612671 |
description | A simple file upload and download server in Rust using Actix |
homepage | |
repository | https://github.com/LunaStev/fexon |
max_upload_size | |
id | 1458336 |
Cargo.toml error: | TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
Fexon is a simple file upload and download server written in Rust. It uses the Actix framework to provide functionality for uploading and downloading files over HTTP. It offers a fast and secure file management server solution.
To include fexon
in your Rust project, add it to your Cargo.toml
file as follows:
[dependencies]
fexon = "0.1.5"
actix-web = "4.0"
Below is an example code to upload and download files using fexon
.
use fexon::{start_server, upload_file, download_file};
use actix_web::{web, App, HttpServer};
#[actix_web::main]
async fn main() -> std::io::Result<()> {
HttpServer::new(|| {
App::new()
.route("/upload", web::post().to(upload_file))
.route("/download/{file_name}", web::get().to(download_file))
})
.bind("127.0.0.1:8080")?
.run()
.await
}
To upload a file, send a POST
request to the /upload
endpoint with the file as multipart/form-data
.
To download a file, send a GET request to the /download/{file_name} endpoint.
POST /upload
: Upload a file.
multipart/form-data
.GET /download/{file_name}: Download a file by its name.
This project is licensed under the Mozilla Public License 2.0 (MPL-2.0). Please refer to the LICENSE file for more details.
If you'd like to contribute to fexon, feel free to fork the repository and create a pull request. Contributions are always welcome!