This project mainly help to upload images to some hosting services like Picasa, Imageshack, Imgur
- Author: Phan Thanh Cong [email protected]
- Copyright: 2010-2014 Phan Thanh Cong.
- License: http://www.opensource.org/licenses/mit-license.php MIT License
- Version: 5.0 stateble
- http://ptcong.com/imageuploader5 (version 5.1 - no free)
- Version 5.1 include user interface and Flickr plugin and more features is paid, you may contact me to get it.
- Change class name from
\ChipVN\ImageUploader\ImageUploader
toChipVN_ImageUploader_ImageUploader
- Support PHP >= 5 (does not require >= 5.3)
- Supports composer
- Change factory method from
\ChipVN\Image_Uploader::factory
toChipVN_ImageUploader_ImageUploader::make
- Make it simpler (only 5 php files)
- Remove
upload to local server - Update Imageshack plugin
- Fix Imgur auth
Require PHP 5.3 or newer- Rewrite all plugins to clear
- Upload image to Imageshack, Picasa
Upload image to local server- Upload image to remote service like (picasa, imageshack, imgur)
- Remote: can free upload to imgur, imageshack or upload to your account. Picasa must be login to upload
- Easy to make new plugin for uploading to another service
Add require "ptcong/php-image-uploader": "5.0.*@dev"
to composer.json and run composer update
Download ChipVN_Http_Request
from https://github.com/ptcong/php-http-class and put it to ChipVN/Http
folder, then include two files:
include 'ChipVN_Http_Request.php';
include 'ChipVN_ImageUploader_ImageUploader.php';
then
To upload image to Picasa, you need to have some AlbumIds otherwise the image will be uploaded to default album.
To create new AlbumId faster, you may use echo $uploader->addAlbum('testing 1');
$uploader = ChipVN_ImageUploader_ImageUploader::make('Picasa');
$uploader->login('your account here', 'your password here');
// you can set upload to an albumId by array of albums or an album, system will get a random album to upload
//$uploader->setAlbumId(array('51652569125195125', '515124156195725'));
//$uploader->setAlbumId('51652569125195125');
echo $uploader->upload(getcwd(). '/test.jpg');
// this plugin does not support transload image
$uploader = ChipVN_ImageUploader_ImageUploader::make('Imageshack');
$uploader->login('your account here', 'your password here');
$uploader->setApi('your api here');
echo $uploader->upload(getcwd(). '/a.jpg');
echo $uploader->transload('http://img33.imageshack.us/img33/6840/wz7u.jpg');
$uploader = ChipVN_ImageUploader_ImageUploader::make('Imgur');
// you may upload with anonymous account but may be the image will be deleted after a period of time
// $uploader->login('your account here', 'your password here');
echo $uploader->upload(getcwd(). '/a.jpg');
echo $uploader->transload('http://img33.imageshack.us/img33/6840/wz7u.jpg');