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