PHP Classes
elePHPant
Icontem

File: exampleusage.php

Recommend this page to a friend!
  Classes of Meric Soft  >  Simple PHP FileSystem Class  >  exampleusage.php  >  Download  
File: exampleusage.php
Role: Example script
Content type: text/plain
Description: example file
Class: Simple PHP FileSystem Class
Manipulate files in several ways
Author: By
Last change:
Date: 9 days ago
Size: 850 bytes
 

 

Contents

Class file image Download
<?php
require_once "classes/fsclass.php"; //fs class
switch ($_REQUEST["type"]) {
    case
"imgUpload": //file type=image
       
$up=Fs::create("file");
       
$up->files="images";
       
$up->folder=$_SERVER["DOCUMENT_ROOT"]."/image/tour_pictures/";
        echo
$up->fUpload("image"); //return results
       
break;
   
    case
'imgList': //picture list
       
$images=Fs::create("file");
       
$images->folder=$_SERVER["DOCUMENT_ROOT"]."/image/tour_pictures";
       
$images->extPattern="*.{png,PNG,jpg,JPG,jpeg,JPEG,svg,SVG,gif,GIF}"; //you can modified here
       
$images->params=GLOB_BRACE;
        echo
json_encode($images->fList());
        break;
    case
"imgDel":
       
$del=FS::create("file");
       
$del->folder=$_SERVER["DOCUMENT_ROOT"]."/image/tour_pictures";
       
$del->params=explode(",",$_REQUEST["imgList"]);
        echo
$del->fDel();
        break;

    default:
       
# code...
       
break;
}