library php-image-upload
Easily upload images to third-party services
jsifuentes/php-image-upload
Easily upload images to third-party services
- Wednesday, April 29, 2015
- by jsifuentes
- Repository
- 1 Watchers
- 0 Stars
- 48 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 1 Versions
- 2 % Grown
PHP Image Uploading
PHP Image Uploading is a library that allows you to easily upload images to third-party services like Imgur and Imageshack., (*1)
use ImageUpload\Services\Imgur as Imgur;
use ImageUpload\Services\ImageShack as ImageShack;
// Imgur - uploading with a url, full path, or base64 string
$imgur = new Imgur('API Key');
$imgur->upload('http://website.com/image.png');
$imgur->upload(file_get_contents(__DIR__ . '/image.png'));
$imgur->upload('SGFoYWhhIHRoaXMgaXMgZHVtbXkgZGF ... 0YSBmb3IgbXkgcmVwb3NpdG9yeQ==');
// Imageshack - uploading an image or video
$imageshack = new ImageShack('API Key');
$imageshack->upload('http://website.com/image.png');
$imageshack->upload(file_get_contents(__DIR__ . '/image.png'));
$imageshack->uploadVideo(file_get_contents(__DIR__ . '/video.mp4'));
// Uploading an image or video with an account
$imageshack->withCredentials('username', 'password')->upload(file_get_contents(__DIR__ . '/image.png'));
$imageshack->withCookie('cookie key')->upload(file_get_contents(__DIR__ . '/image.png'));
This project is available on Packagist., (*2)
dev-master
9999999-dev
Easily upload images to third-party services
Sources
Download
MIT
images
imgur
imageshack