Login   Register  
PHP Classes
elePHPant
Icontem

File: imageUploader_example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Feighen Oosterbroek  >  Image Uploader and Resizer  >  imageUploader_example.php  >  Download  
File: imageUploader_example.php
Role: Example script
Content type: text/plain
Description: imageUploader_example.php
Class: Image Uploader and Resizer
Process and resize uploaded image files
Author: By
Last change:
Date: 2009-07-16 12:22
Size: 544 bytes
 

Contents

Class file image Download
<?php
/* Example for Image Uploader class */
if ($_FILES && !$_FILES['image']['error']) {
    require_once(
'./ImageUploader.php');
    
$opts = (array)array();
    
$opts['dir'] = 'styleimgs/';
    
$opts['src'] = $_FILES['image']['tmp_name'];
    
$opts['dest'] = $_FILES['image']['name'];
    if ((
$iu = new ImageUploader($opts)) === false) {unset($opts);}
} else {
    echo 
'<form method="POST" enctype="multipart/form-data">';
    echo 
'<input type="file" value="Choose a file..." />';
    echo 
'<input type="submit" value="Submit" />';
    echo 
'</form>';
}