PHP Classes

File: upload-01.php

Recommend this page to a friend!
  Classes of Krzysztof Kardasz   Nweb Image   upload-01.php   Download  
File: upload-01.php
Role: Example script
Content type: text/plain
Description: Example
Class: Nweb Image
Perform several image manipulation operations
Author: By
Last change:
Date: 17 years ago
Size: 1,387 bytes
 

Contents

Class file image Download
<?php
/**
 * Nweb Extension Script
 *
 * Example
 *
 * @category Nweb
 * @package Nweb_Scripts
 * @author Krzysztof Kardasz
 * @copyright Copyright (c) euo.pl
 */


   
include 'lib/Image.php';
    include
'lib/ImageException.php';
    include
'lib/ImageUpload.php';
    include
'lib/ImageUploadException.php';

try {

   
$upload = new ImageUpload();

   
#upload(string|array nazwy indeksów plików <input name="indeks" )
   
$upload->upload('obraz');

   
#uploadSave ([string katalog docelowy,] [string nazwa pliku,] [boolean automatyczna zmiana nazw,] [int start numerowania])
   
$upload->uploadSave ('uploads/');

   
#$upload->GetMessages()

   
$Messages = implode('<br />', $upload->GetMessages ());
}

catch (
ImageUploadException $e)
{
    die(
$e->Message());
}

?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>ImageUpload - 01</title>
</head>
<body>
<h3><?php echo (!empty($Messages)) ? $Messages : 'Upload zdjęć'; ?></h3>
<form enctype="multipart/form-data" action="" method="post">
<fieldset>
    <label>Zdjęcie</label>
    <input name="obraz" type="file" />
</fieldset>
 <input type="submit" name="submit" value="Upload" />
</form>

</body>
</html>