PHP Classes
elePHPant
Icontem

File: example-upload.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Unay Santisteban  >  Simple Uploader  >  example-upload.php  >  Download  
File: example-upload.php
Role: Example script
Content type: text/plain
Description: Example of class usage
Class: Simple Uploader
Validate and save uploaded files
Author: By
Last change:
Date: 11 months ago
Size: 445 bytes
 

Contents

Class file image Download
<?php
include 'upload.class.php';
if (isset(
$_FILES['file'])) {
   
$uploaded = new Upload($_FILES['file']);

   
$types = array('image/png');
   
$ext = array('png');
   
$size = 1;
   
   
$uploaded->validate($size, $ext, $types);
   
$estado = $uploaded->save('stored/');

    if(
$estado){
       echo
"Imagen Guardada correctamente.";
      
$uploaded->rename('imagen1.png');

    } else {
       echo
"Imagen no valida.";
    }
}
?>