Login   Register  
PHP Classes
elePHPant
Icontem

File: upload.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Antonello Mangone  >  File-Uploader  >  upload.php  >  Download  
File: upload.php
Role: Example script
Content type: text/plain
Description: example use
Class: File-Uploader
Validate and process uploaded files with forms
Author: By
Last change:
Date: 2010-12-09 03:32
Size: 1,168 bytes
 

Contents

Class file image Download
<!doctype html public "-//W3C//DTD HTML 4.0 //EN">
<html>
<head>
    <title>.:: file upload by settings ::.</title>
    <link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
    <form enctype="multipart/form-data" method="post">
    <table align="center" width="500">
        <tr><td align="center" class="hf">.:: file upload by settings ::.</td></tr>
        <tr><td align="left" class="formUp">
        <ul>
        <li><b>maximum size:</b> 100 kb</li>
        <li><b>extensions admitted:</b> .gif .jpg .jpeg .png</li>
        </ul>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="file" name="upload" />
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="submit" name="send" value="Upload" class="bottone"/>
        <ul>
        </ul>
        </td></tr>
        <tr><td align="center" class="hf">&copy; <a href="mailto:antonello.mangone@gmail.com">Antonello Mangone</a></td></tr>
    </table>
    </form>
    <?php
        
if ($_POST["send"] == "Upload") {
                require_once(
"classFileUploader.php");
                
$extensions = array("image/gif""image/jpg""image/jpeg""image/png");
                
$upload = new fileUploader("images/","100000",$extensions,$_FILES['upload']);
                print 
$upload->result;
        }
    
?>
</body>
</html>