Basic PHP Upload
// Simple file upload and transformation
use Filestack\FilestackClient;
$client = new FilestackClient('YOUR_API_KEY');
// Upload a file
$filelink = $client->upload('/path/to/image.jpg');
echo "Uploaded: " . $filelink->url() . "\n";
// Transform the image
$transformation = $client->transform(
$filelink->handle,
['resize' => ['width' => 300, 'height' => 300]]
);
echo "Transformed: " . $transformation->url();Built for PHP Developers
Our PHP SDK follows PHP-FIG standards and best practices, providing a reliable, well-documented solution for all your file management needs.
PSR Compliant
Follows PHP-FIG standards including PSR-4 autoloading, PSR-3 logging, and PSR-7 HTTP messages for seamless integration.
Composer Ready
Easy installation via Composer with proper dependency management and semantic versioning support.
Framework Integration
Native support for Laravel, Symfony, CodeIgniter, and CakePHP with dedicated packages and service providers.
Error Handling
Comprehensive exception handling with detailed error messages, retry logic, and graceful failure recovery.
Memory Efficient
Optimized for handling large files with streaming uploads, chunked processing, and minimal memory footprint.
Legacy Support
Backward compatibility with PHP 5.6+ while supporting modern PHP 8.x features like typed properties and attributes.
Trusted by innovative companies worldwide
Installation & Setup
Get started with our PHP SDK using Composer. Compatible with PHP 5.6+ and all major frameworks.
Composer Installation
composer require filestack/filestack-phpwget https://github.com/filestack/filestack-php/archive/master.zipdocker run --rm -v $(pwd):/app composer require filestack/filestack-php📋 Requirements
- ✓ PHP 5.6+ (PHP 8.x recommended)
- ✓ cURL extension
- ✓ JSON extension
- ✓ OpenSSL support
- ✓ mbstring extension
Basic Usage
Include via Composer autoloader:
require 'vendor/autoload.php';
use Filestack\FilestackClient;
$client = new FilestackClient('YOUR_API_KEY');
Complete PHP Implementation
// Complete working example
require_once 'vendor/autoload.php';
use Filestack\FilestackClient;
// Initialize the client
$client = new FilestackClient('YOUR_API_KEY');
try {
// Upload a file
$filelink = $client->upload('/path/to/image.jpg');
echo "Uploaded: " . $filelink->url() . "\n";
// Transform the image
$transformation = $client->transform($filelink->handle, [
'resize' => ['width' => 300, 'height' => 300],
'quality' => 80
]);
echo "Transformed: " . $transformation->url();
} catch (Exception $e) {
echo "Error: " . $e->getMessage();
}
Integrate PHP File Processing
Join thousands of PHP developers who trust Filestack for reliable, scalable file management. From simple uploads to complex processing workflows, we’ve got you covered.