PHP Classes

File: imageUploader_example.php

Recommend this page to a friend!
  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: 13 years ago
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>';
}

For more information send a message to info at phpclasses dot org.