Login   Register  
PHP Classes
elePHPant
Icontem

File: example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Ahmed Syam  >  Soft Uploader  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: example how to use class
Class: Soft Uploader
Validate and move an uploaded file
Author: By
Last change:
Date: 2014-02-08 08:12
Size: 724 bytes
 

Contents

Class file image Download
<?php


require_once 'upload.class.php';

$up = new uploader();

if(isset(
$_POST['submit']))
    {
    
//give it FILES array with input name
    
$up->Upload_Init($_FILES['file']);

    
//Set Upload directory >>if not found it will be created
    
$up->Upload_Set_dir('uploads');

    
//set allowed mime type
    
$up->Upload_Set_Type(array('image/jpg','image/jpeg','image/png','image/gif'));

    
//set allowed extensions
    
$up->Upload_Set_Ext(array('jpg','jpeg','gif','png'));

    
//Process uploading
    
$upimg $up->Upload();
}




?>
<form action="example.php" method="post" enctype="multipart/form-data">
    
    <input type="file" name="file" />
    <input type="submit" name="submit" value="upload" />
    
</form>