A Laravel-based application providing a highly scalable File Storage System with support for storing files in Local Storage, Amazon S3, or Database Storage.
This application allows developers to upload, retrieve, and manage files via a unified API interface, making it easy to integrate with various storage solutions.
Dr.ive provides a flexible and modular architecture to store and retrieve files. Files can be stored in:
- Local Storage: Using Laravel's built-in storage system.
- Amazon S3: For scalable and distributed cloud storage.
- Database Storage: For saving files as Base64 encoded strings directly in the database.
The application utilizes a Service Factory Pattern to dynamically switch between storage types based on the configuration or request.
# Default Storage
FILESYSTEM_DISK=local
STORAGE_BACKEND=s3
# AWS S3 Configuration (Optional)
AWS_ACCESS_KEY_ID=YOUR_AWS_ACCESS_KEY
AWS_SECRET_ACCESS_KEY=YOUR_AWS_SECRET_KEY
AWS_DEFAULT_REGION=YOUR_AWS_REGION
AWS_BUCKET=YOUR_AWS_BUCKET
AWS_USE_PATH_STYLE_ENDPOINT=falsePOST /api/v1/Dr.ive/store
unique_identifier(string, required): A unique identifier for the file.storage(string, optional): The storage type (local,s3, ordatabase). Defaults to theSTORAGE_BACKENDin your.env.file(file, optional): The file to be stored.data(string, optional): Base64 encoded data (used if no file is uploaded).
POST /api/v1/Dr.ive/store
Content-Type: multipart/form-data
{
"unique_identifier": "example-file",
"file": "<file>"
}POST /api/v1/Dr.ive/store
Content-Type: application/json
{
"unique_identifier": "example-text",
"data": "SGVsbG8gd29ybGQ="
}GET /api/v1/Dr.ive/show/{unique_identifier}
id: The unique identifier of the stored file.size: The size of the stored file.created_at: The date and time of storage.data_type: Indicates whether the response contains text or file.data: The Base64 encoded data if it's text.filename: The file name if it's a file.filetype: The MIME type of the file if it's a file.
{
"id": "example-text",
"size": 11,
"created_at": "2025-03-26 12:00:00",
"data_type": "text",
"data": "Hello world"
}{
"id": "example-file",
"size": 20480,
"created_at": "2025-03-26 12:00:00",
"data_type": "file",
"filename": "example.pdf",
"filetype": "application/pdf",
"data": "BASE64_ENCODED_FILE_CONTENT"
}