PHP Classes

Simple PHP FileSystem Class: Manipulate files in several ways

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 178 All time: 8,740 This week: 488Up
Version License PHP version Categories
fsclass 1.0.0GNU General Publi...7PHP 5, Files and Folders
Description 

Author

This is a simple class that can manipulate files in several ways.

It provides several functions that can perform several types of operations on files.

Currently it can handle uploaded files and move them to a separate directory, delete a list of files, and retrieve the list of files of a given directory.

Picture of Meric Soft
Name: Meric Soft <contact>
Classes: 1 package by
Country: Turkey Turkey

 

Example

<?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;
}




  Files folder image Files (2)  
File Role Description
Accessible without login Plain text file exampleusage.php Example example file
Plain text file fsclass.php Class filesystem class

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 0%
Total:178
This week:0
All time:8,740
This week:488Up