Add php files
This commit is contained in:
25
modules/EcmReports/RaportMSH/FileHandler.php
Normal file
25
modules/EcmReports/RaportMSH/FileHandler.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
class FileHandler{
|
||||
public $target_dir='upload/';
|
||||
public $input_name='fileToUpload';
|
||||
public $target_file;
|
||||
public $orginal_file;
|
||||
public $file_id;
|
||||
public $file_date;
|
||||
|
||||
public function __construct(){
|
||||
$this->file_id=create_guid();
|
||||
$this->target_file=$this->target_dir.basename($this->file_id.'.xls');
|
||||
$this->orginal_file=$_FILES[$this->input_name]["name"];
|
||||
}
|
||||
|
||||
public function uploadFile(){
|
||||
if (move_uploaded_file($_FILES[$this->input_name]["tmp_name"], $this->target_file)) {
|
||||
$this->file_date= date ("Y-m-d H:i:s", filemtime($this->target_file));
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user