2 /*switch ($_FILES['uploadFile']['error']) {
4 // '<p> The file is bigger than this PHP installation allows</p>';
7 // '<p> The file is bigger than this form allows</p>';
10 // '<p> Only part of the file was uploaded</p>';
13 // '<p> No file was uploaded</p>';
17 class upload
extends tsAdminPage
{
18 public function __construct(){
19 parent
::__construct();
21 $this->varArray
['title'] = 'adm';
23 $action = tsPage
::getRequest ('do');
25 if (empty ($action)) {
32 private function display () {
34 $upl = new tsFile ($dir);
36 $t = $upl->getChildren();
38 foreach ($t as $key => $file) {
39 $out[$key]['id'] = $key;
40 $out[$key]['url'] = $file->icon
;
41 $out[$key]['path'] = $file->URL
;
42 $out[$key]['name'] = $file->name
;
44 $out[$key]['mimetype'] = $file->type
;
47 $this->varArray
['pics'] = $out;
48 $this->varArray
['URL'] = BASE_URL
;
49 $this->varArray
['action'] = tsPage
::setRequest(get_class($this), array('do'=>'upload'));
52 private function upload () {
53 // at the moment we'll have only one upload
54 if (!empty($_FILES)) {
55 $fName = $_FILES['f']['name'];
56 $upload = UPLOAD_PATH
.DIRECTORY_SEPARATOR
.$fName;
58 //$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);
59 $t = move_uploaded_file ($_FILES['f']['tmp_name'] , $upload);
62 // tsPage::redirect(tsPage::setRequest(get_class($this)));