PHP Classes

File: upload_test.php

Recommend this page to a friend!
  Classes of Biju   File Upload System   upload_test.php   Download  
File: upload_test.php
Role: Example script
Content type: text/plain
Description: Example for uploading files
Class: File Upload System
Validate and process file uploads
Author: By
Last change: Example to use the File upload class
Date: 15 years ago
Size: 654 bytes
 

Contents

Class file image Download
<?php
include("objupload.class.php");

  if(
$_FILES["upfile"]["name"]!="")
  {
 
$upfile= new ObjUpload('upfile'); // upfile is form file field name
 
 
$upfile->setExtensions('jpeg,jpg,png,gif,flv'); // Permitted file extensions
 
 
$upfile->upload('tpl',null,true,200,200,1048576); // upload folder,filename,uniquenamesetting,optional width (For images), Optional height (For Images), maximum filesize
  
echo $upfile->upResult;
   }
  
?>
<form action="" method="post" enctype="multipart/form-data" name="form1" id="form1">
  <input name="upfile" type="file" />
  <input name="add" type="submit" value="ADD" />
   </form>