Developer Hub
PappyMall Storage SDK
Official SDKs for Node.js & .NET. Store, manage & deliver any file type up to 5 GB with a one-line API.
Installation
Official SDK:
@pappymall/storage
npm Package
npm install @pappymall/storage
# or
yarn add @pappymall/storage
Quick Start
const { PappyStorage } = require('@pappymall/storage');
const storage = new PappyStorage({
accessKey: 'your-access-key',
secretKey: 'your-secret-key'
});
// Upload a product image
const file = await storage.putObject('product-images', 'products/shoe-123.jpg', imageBuffer, {
content_type: 'image/jpeg'
});
// Store the URL in your database
const imageUrl = file.downloadUrl;
console.log('Image URL:', imageUrl);
NuGet Package
dotnet add package PappyMall.Storage.SDK
Quick Start
using PappyMall.Storage.SDK;
var client = new PappyStorageClient(
"your-access-key",
"your-secret-key",
new PappyStorageConfig
{
ServiceUrl = "https://pappymall.com/api/v1/storage"
}
);
Authentication
Authenticate using your API Key and API Secret. Generate these from your dashboard under Storage → Manage → API Keys.
Security: Keep your API Secret secure. Never expose it in client-side code or public repositories.
// Store credentials securely
var accessKey = Environment.GetEnvironmentVariable("PAPPYMALL_ACCESS_KEY");
var secretKey = Environment.GetEnvironmentVariable("PAPPYMALL_SECRET_KEY");
var client = new PappyStorageClient(accessKey, secretKey);
Bucket Management
List Buckets
GET// List all buckets
var buckets = await client.ListBucketsAsync();
foreach (var bucket in buckets)
{
Console.WriteLine($"{bucket.Name} - {bucket.FileCount} files");
}
Create Bucket
POST// Create a new bucket
var bucket = await client.CreateBucketAsync(
bucketName: "invoices",
isPublic: false,
description: "Company invoices storage"
);
Delete Bucket
DELETE// Delete a bucket (must be empty)
await client.DeleteBucketAsync("old-bucket");
File Operations
Supports ALL file types up to 5GB each
Upload Object
POST// Upload file - ONE LINE!
await client.PutObjectAsync(
bucketName: "invoices",
key: "2024/invoice-001.pdf",
filePath: @"C:\Documents\invoice.pdf"
);
// Upload from byte array
byte[] data = File.ReadAllBytes("file.dat");
await client.PutObjectAsync("my-bucket", "data.bin", data);
Download Object
GET// Download file - ONE LINE!
await client.DownloadObjectAsync(
bucketName: "invoices",
key: "2024/invoice-001.pdf",
destinationPath: @"C:\Downloads\invoice.pdf"
);
List Objects
GET// List files in bucket
var files = await client.ListObjectsAsync(
bucketName: "invoices",
prefix: "2024/" // Optional filter
);
foreach (var file in files)
{
Console.WriteLine($"{file.FileName} - {file.FileSize} bytes");
}
Delete Object
DELETE// Delete file
await client.DeleteObjectAsync("invoices", "old/invoice.pdf");
Complete Examples
Complete Node.js Example - Product Image Management
const { PappyStorage } = require('@pappymall/storage');
const fs = require('fs');
// Initialize Client
const storage = new PappyStorage({
accessKey: process.env.STORAGE_ACCESS_KEY,
secretKey: process.env.STORAGE_SECRET_KEY
});
// 1. Create a bucket for product images
await storage.createBucket('product-images');
// 2. Upload a product image
const imageBuffer = fs.readFileSync('./shoe.jpg');
const file = await storage.putObject('product-images', 'products/shoe-123.jpg', imageBuffer, {
content_type: 'image/jpeg'
});
// Response contains:
// - file.objectKey - 'products/shoe-123.jpg'
// - file.fileName - 'shoe-123.jpg'
// - file.fileSize - Size in bytes
// - file.contentType - 'image/jpeg'
// - file.downloadUrl - URL to store in database
// 3. Save the URL to your database
const product = {
id: 123,
name: 'Running Shoe',
image_url: file.downloadUrl // Store this!
};
await db.products.insert(product);
// 4. List all product images
const images = await storage.listObjects('product-images', {
prefix: 'products/'
});
console.log(`Found ${images.length} product images`);
// 5. Download an image
const obj = await storage.getObject('product-images', 'products/shoe-123.jpg');
console.log(obj.data); // Buffer
console.log(obj.content_type); // 'image/jpeg'
// 6. Update image tags
await storage.updateObject('product-images', 'products/shoe-123.jpg', {
tags: 'featured,bestseller'
});
// 7. Delete when product is removed
await storage.deleteObject('product-images', 'products/shoe-123.jpg');
Complete C# / .NET Example
using PappyMall.Storage.SDK;
// Initialize Client
var client = new PappyStorageClient(
"your-access-key",
"your-secret-key",
new PappyStorageConfig
{
ServiceUrl = "https://pappymall.com/api/v1/storage"
}
);
// Create Bucket
await client.CreateBucketAsync("company-documents", isPublic: false);
// Upload File - Supports ALL file types!
await client.PutObjectAsync(
"company-documents",
"contracts/2024-agreement.pdf",
@"C:\\files\\agreement.pdf"
);
// List files
var files = await client.ListObjectsAsync("company-documents", prefix: "contracts/");
foreach (var file in files)
{
Console.WriteLine($"{file.FileName} - {file.FileSize} bytes");
}
// Download File
await client.DownloadObjectAsync(
"company-documents",
"contracts/2024-agreement.pdf",
@"C:\\Downloads\\agreement.pdf"
);
// Delete File
await client.DeleteObjectAsync("company-documents", "old/invoice.pdf");
Why PappyMall Storage?
All File Types
ANY file type up to 5 GB — images, videos, PDFs, executables.
Built-in Sharing
Share files directly with users — unique to PappyMall.
One-Line API
Upload and download in a single line of code.
Self-Hosted
Your data on your infrastructure. No vendor lock-in.
Web UI Included
Drag-drop interface with grid/list views & bulk ops.
No Hidden Costs
No per-request fees, no egress charges.
Ready to use PappyMall Storage?
Install the SDK and start storing files in minutes.