Login   Register  
PHP Classes
elePHPant
Icontem

File: esempio.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of StefanoV89  >  Classe Upload  >  esempio.php  >  Download  
File: esempio.php
Role: Example script
Content type: text/plain
Description: Pagina a cui Punta il Form HTML
Class: Classe Upload
Validate and handle uploaded files
Author: By
Last change:
Date: 7 years ago
Size: 601 bytes
 

Contents

Class file image Download
<?php

    
// include la libreria
    
include("libs/upload.class.inc.php");
    
    
// valorizza la variabile
    
$test = new Uploader();
    
    
// Opzioni: controllo estensione, sovracrittura
    
$test->opzioni_up(array('lock_ext' => 1'overwrite' => 0));
    
    
// se lock_ext = 1 bisogna mettere le estensioni consentite
    
$test->estensioni_ok(array('zip''rar''mp3''jpg' 'gif'));
    
    
// uppa il file, paramentri: nome del campo di tipo file, cartella dove uppare
    
$test->upload_file('userfile','files/');
    
    
// stampa l'Url del file Uppato
    
print("<br />" $test->get_url(basename(__FILE__)));
?>