Byte Fortress is a Rust-based file storage and management system that utilizes RocksDB for efficient data storage and retrieval.
Download and run directly:
git clone https://github.com/Sanket3dx/byte_fortress.git
cargo build --release
./target/release/byte_fortress
To upload a file, send a POST request to the /file endpoint with the file data in the request body. Include the file path in the x-full-file-path header and the Content-Type header with the appropriate MIME type.
Example using curl:
curl -X POST -H "x-full-file-path: /path/to/file.txt" -H
"Content-Type: application/octet-stream" --data-binary
@/path/to/file.txt http://localhost:8080/file
To download a file, send a GET request to the /file endpoint with the file path in the x-full-file-path header.
Example using curl:
curl -X GET -H "x-full-file-path: /path/to/file.txt" http://localhost:8080/file
To update a file, send a POST request to the /file endpoint with the updated file data in the request body. Include the file path in the x-full-file-path header and the Content-Type header with the appropriate MIME type. If a file with the same path already exists, it will be overwritten with the new data.
Example using curl:
curl -X POST -H "x-full-file-path: /path/to/file.txt" -H "Content-Type: application/octet-stream" --data-binary @/path/to/updated_file.txt http://localhost:8080/file
To delete a file, send a DELETE request to the /file endpoint with the file path in the x-full-file-path header.
Example using curl:
curl -X DELETE -H "x-full-file-path: /path/to/file.txt" http://localhost:8080/file