2017 © Pedro Peláez
 

library image-uploader

A simple and elegant PHP library for uploading and serving images

image

fknussel/image-uploader

A simple and elegant PHP library for uploading and serving images

  • Wednesday, May 4, 2016
  • by fknussel
  • Repository
  • 1 Watchers
  • 0 Stars
  • 8 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 12 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

image-uploader

A simple yet elegant PHP library for uploading and serving images. The aim of this project is to act as an interface to image uploading and serving on a media server., (*1)

Prerequisites

  1. Successfully tested on PHP >= 5.5
  2. GD is required (sudo apt-get install php5-gd will do)

Installation using Composer

Add the following dependency to your composer.json file:, (*2)

{
  "require": {
    "fknussel/image-uploader": "dev-master"
  }
}

Fetch the dependecy by running:, (*3)

php composer.phar install

Finally, import image-uploader into your script:, (*4)

require("vendor/autoload.php");

Usage

Serving images

try {
  $imageUploader = new ImageUploader(UPLOAD_DIR, MD5_HASH_SALT);
  $res = $imageUploader->serve($_GET["identifier"]);
  var_dump($res);
} catch (Exception $e) {
  var_dump($e);
}

Uploading images

try {
  $imageUploader = new ImageUploader();
  $imageUploader->setPath(UPLOAD_DIR);
  $imageUploader->setSalt(MD5_HASH_SALT);
  $imageUploader->setMaxFileSize(MAX_FILE_SIZE);

  $uid = time() . rand();
  $success = $imageUploader->upload($_FILES[INPUT_FIELD_NAME], $uid);

  echo json_encode(array("success" => $success));
} catch (Exception $e) {
  die($e);
}

License

image-uploader is MIT licensed., (*5)

This project is a somewhat modified version of Dhaval Kapil's image-uploader., (*6)

The Versions

04/05 2016

dev-master

9999999-dev https://github.com/fknussel/image-uploader

A simple and elegant PHP library for uploading and serving images

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

upload image serve

04/05 2016

v1.2.0

1.2.0.0 https://github.com/fknussel/image-uploader

A simple and elegant PHP library for uploading and serving images

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

upload image serve

04/05 2016

v1.1.0

1.1.0.0 https://github.com/fknussel/image-uploader

A simple and elegant PHP library for uploading and serving images

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

upload image serve

03/05 2016

v1.0.0

1.0.0.0 https://github.com/fknussel/image-uploader

A simple and elegant PHP library for uploading and serving images

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

upload image serve