verot.net - class.upload.php

http://www.verot.net/php_class_upload.print

upload.jpg This PHP script uploads files and manipulates images very easily. The perfect script to generate thumbnails or create a photo gallery! It can convert, resize and work on uploaded images in many ways, add labels, watermarks and reflections and other image editing features. It uses the GD library. This script is released under the GPL Version 2. If your project is not GPL, commercial licenses are available.

version 0.25 released!

Version 0.25 has been released, with a great number of new features. It is a major rewrite of the graphic manipulation code, with improvements for transparency support and true color images. Check out some demo samples.

What is it?

An example will be more useful than any blurb I can write :

$foo = new Upload($_FILES['form_field']); 
if ($foo->uploaded) {
  // save uploaded image with no changes
  $foo->Process('/home/user/files/');
  if ($foo->processed) { 
    echo 'original image copied'; 
  } else {
    echo 'error : ' . $foo->error;
  }
  // save uploaded image with a new name
  $foo->file_new_name_body = 'foo';
  $foo->Process('/home/user/files/');
  if ($foo->processed) {
    echo 'image renamed "foo" copied';
  } else { 
    echo 'error : ' . $foo->error; 
  }
  // save uploaded image with a new name,
  // resized to 100px wide
  $foo->file_new_name_body = 'image_resized';
  $foo->image_resize = true;
  $foo->image_convert = gif;
  $foo->image_x = 100;
  $foo->image_ratio_y = true;
  $foo->Process('/home/user/files/');
  if ($foo->processed) {
    echo 'image renamed, resized x=100 
          and converted to GIF';
    $foo->Clean();
  } else {
    echo 'error : ' . $foo->error;
  }
}

What does it actually do in this example?

This example uses a file uploaded via a form. With this single file, it will :

How does it work?

Why use this class?

Is it out there on Internet?

class.upload.php is featured on HotScripts. If you like the script, please rate it or write a review for it. You can find it here : http://www.hotscripts.com/Detailed/45364.html

class.upload.php is featured on PHP Classes. If you like the script, please rate it there. You can find it here : http://www.phpclasses.org/browse/package/2181.html

class.upload.php is featured on Freshmeat. If you like the script, please rate it there. You can find it here : http://freshmeat.net/projects/class_upload_php/

Commercial licenses

Commercial licenses are available here.

copyright 2001-2006 © Colin Verot - powered by The CMF