PHP Classes

Simple PHP FileSystem Class: Manipulate files in several ways

Recommend this page to a friend!
  Info   View files Example   View files View files (2)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 178 This week: 1All time: 8,733 This week: 560Up
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
Age: ???
All time rank: 421077 in Turkey Turkey
Week rank: 411 Up9 in Turkey Turkey Up

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  
File Role Description
Accessible without login Plain text file exampleusage.php Example example file
Plain text file fsclass.php Class filesystem class

 Version Control Unique User Downloads Download Rankings  
 0%
Total:178
This week:1
All time:8,733
This week:560Up