Giter Site home page Giter Site logo

php-remote-image-uploader's Introduction

PHP-Remote-Image-Uploader

This project mainly help to remote upload images to some hosting services like Picasa, Imageshack, Imgur, Postimage, etc.

The library is free, but if you need an add-on for xenforo or web tools to upload images, please purchase PAID version under with $12.5, just like gift me a beer.

  • Author: Phan Thanh Cong [email protected]
  • Copyright: 2010-2014 Phan Thanh Cong.
  • License: MIT
  • Version: 5.2.17

PAID version

Issues (for both paid and free version)

Change Logs

Version 5.2.17; Jun 13, 2015

  • Postimage fully fixes

Version 5.2.15; May 27, 2015

  • No longer support Flickr login with accounts. Must use API
  • Add new PicasaNew uploader that use API version 2 with OAuth 2.0

Version 5.2.14; Mar 07, 2015

  • Fix Postimage not found image url in some cases.

Version 5.2.13; Jan 19, 2015

  • Clean all plugins
  • Optimize, rewrite a part of Picasa plugin and fixed a bug while checking permission; increase session expires time to 900 seconds.
  • Use new version of ChipVN_Http_Client to get higher performance when upload large file.

Version 5.2.12; Oct 14, 2014

  • Update: Flickr requestToken method to avoid error if headers has sent.
Version 5.2.8; Oct 06, 2014
  • Update: Imgur plugin to use API version 3 (require API Client ID, Secret)
Version 5.2.3: Jul 10, 2014
  • Update Flickr API (SSL required)
  • Update vendor, ChipVN library
  • Update Picasa plugin to get URL not resized, use account by custom email
  • New Postimage plugin
Version 5.0.1: Apr 2, 2014
  • Change class name from \ChipVN\ImageUploader\ImageUploader to ChipVN_ImageUploader_ImageUploader for usable on all PHP version >= 5.0
Version 5.0: Mar 07, 2014
  • Supports composer
  • Change factory method from \ChipVN\Image_Uploader::factory to ChipVN_ImageUploader_ImageUploader::make
  • Make it simpler (only 5 php files)
  • Remove upload to local server
  • Update Imageshack plugin
Version 4.0.1: Sep, 2013
  • Fix Imgur auth
Version 4.0: Jul 25, 2013
  • Require PHP 5.3 or newer
  • Rewrite all plugins to clear
Version 1.0: June 17, 2010
  • Upload image to Imageshack, Picasa

Features

  • 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

Usage

If you use composer

Add require "ptcong/php-image-uploader": "dev-master" to composer.json and run composer update, if you catch an issue about stability, should add "minimum-stability" : "dev" to your composer.json

If you don't use composer

Download

and include the code on the top of your file:

include '/path/path/ChipVN/ClassLoader/Loader.php';
ChipVN_ClassLoader_Loader::registerAutoLoad();

then

Upload to Picasa - ver 1

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_Manager::make('Picasa');
$uploader->login('your account', 'your password');
// 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

Upload to Picasanew - ver 2 (use OAuth 2.0)

To upload image to Picasanew, 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_Manager::make('Picasanew');
$uploader->login('your user name', ''); // we don't need password here
$uploader->setApi('Client ID'); // register in console.developers.google.com
$uploader->setSecret('Client secret');
// 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');
if (!$uploader->hasValidToken()) {
    $uploader->getOAuthToken('http://yourdomain.com/test.php');
}
echo $uploader->upload(getcwd(). '/test.jpg');
// this plugin does not support transload image

Upload to Flickr

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_Manager::make('Flickr');
$uploader->setApi('API key');
$uploader->setSecret('API secret');
$token = $uploader->getOAuthToken('http://yourdomain.com/test.php');
$uploader->setAccessToken($token['oauth_token'], $token['oauth_token_secret']);
echo $uploader->upload(getcwd(). '/test.jpg');
// this plugin does not support transload image

Upload to Imageshack

$uploader = ChipVN_ImageUploader_Manager::make('Imageshack');
$uploader->login('your account', 'your password');
$uploader->setApi('your api here');
echo $uploader->upload(getcwd(). '/a.jpg');
echo $uploader->transload('http://img33.imageshack.us/img33/6840/wz7u.jpg');

Upload to Imgur

$uploader = ChipVN_ImageUploader_Manager::make('Imgur');
$uploader->setApi('your client id');
$uploader->setSecret('your client secret');
// 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');

Upload to Postimage

$uploader = ChipVN_ImageUploader_Manager::make('Postimage');
// 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');

php-remote-image-uploader's People

Contributors

anhskohbo avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.