Image Chunking Middleware for Golem DB
A middleware that splits large images into safe-sized chunks, stores them on Golem DB, and serves them back as a single file. Perfect for NFT images, app assets, and media storage.
Built for developers who need reliable image storage on Golem DB
Upload images up to 25MB. Files are automatically chunked into 64KB pieces that fit Golem DB limits.
SHA-256 checksums ensure your images are retrieved exactly as uploaded, with full integrity verification.
Resume failed uploads and prevent duplicates with built-in idempotency keys and session management.
Set custom expiration times for your images. Default 7-day TTL for free tier, extendable with wallet mode.
Built-in quota management with 100MB storage and 10 uploads per day on the free tier.
RESTful API with straightforward endpoints. Upload with POST, retrieve with GET, monitor with status endpoints.
Get up and running in minutes
docker run -p 3000:3000 moonplkr/imagesdb:latest
curl -X POST http://localhost:3000/media \
-F "file=@image.png" \
-H "Idempotency-Key: unique-key-123"
curl http://localhost:3000/media/YOUR_MEDIA_ID \
-o retrieved-image.png
Download our lightweight JavaScript SDK for easy integration
Download SDK (2KB)import ImageDB from './imagedb-sdk.js';
const client = new ImageDB('http://localhost:3000');
// Upload image
const result = await client.upload(file, {
idempotencyKey: 'unique-key',
ttlDays: 30
});
console.log('Media ID:', result.media_id);
// Retrieve image
const imageBlob = await client.get(result.media_id);
const imageUrl = URL.createObjectURL(imageBlob);
{
"media_id": "6bc95b27-1a5d-46e7-96e7-8edde7de5c70",
"message": "Upload successful"
}
Complete API documentation
Upload an image file to the service
Idempotency-Key
(optional) - Unique key for upload sessionBTL-Days
(optional) - Time to live in days (default: 7)file
- Image file (PNG/JPEG, max 25MB)HTTP 200 OK
Content-Type: application/json
{
"media_id": "uuid-string",
"message": "Upload successful"
}
Retrieve an uploaded image by its media ID
HTTP 200 OK
Content-Type: image/png|image/jpeg
Content-Length: file-size
Content-Disposition: inline; filename="original-name.png"
[Binary image data]
Check current quota usage
{
"used_bytes": 1048576,
"max_bytes": 104857600,
"uploads_today": 3,
"max_uploads_per_day": 10,
"usage_percentage": "1.00"
}
Check upload session status
{
"media_id": "uuid-string",
"completed": true,
"chunks_received": 15,
"total_chunks": 15
}
Upload an image and see the chunking in action
Media ID:
File size:
Chunks created:
Your image is stored as multiple entities on Golem DB: