| 
<?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>
 |