Reliable File Management for PHP Applications
Build robust file handling systems with our mature PHP SDK. Perfect for Laravel, Symfony, CodeIgniter, and any PHP application requiring professional file management.
Basic PHP Upload
<?php
// 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.
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-php
wget https://github.com/filestack/filestack-php/archive/master.zip
docker 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:
<?php
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.