PappyMall Storage SDK
Native .NET SDK for Object Storage
Store, manage, and deliver files. Built-in file sharing, supports ALL file types up to 5GB, with versioning and multipart uploads.
Contents
Installation
NuGet Package
dotnet add package PappyMall.Storage.SDK
Quick Start
Initialize the PappyMall Storage client with your API credentials:
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.
// 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 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"
);
// Download File
await client.DownloadObjectAsync(
"company-documents",
"contracts/2024-agreement.pdf",
@"C:\\Downloads\\agreement.pdf"
);
// Share with User (PappyMall Exclusive!)
await client.ShareFileAsync(
"company-documents",
"contracts/2024-agreement.pdf",
"user-456",
canEdit: false
);
// Get Temporary URL
var url = await client.GetPresignedUrlAsync(
"company-documents",
"contracts/2024-agreement.pdf",
expirationHours: 24
);
Why Choose PappyMall Storage?
All File Types
Upload ANY file type up to 5GB. Images, videos, PDFs, executables - everything works!
Built-in Sharing
Share files directly with users. No other storage SDK has this feature!
One-Line API
Simple, clean API. Upload and download in just one line of code.
Self-Hosted
Keep your data on YOUR infrastructure. No vendor lock-in.
Web UI Included
Beautiful drag-drop web interface with grid/list views and bulk operations.
No Hidden Costs
No per-request fees, no egress charges. One simple price.