Initial commit

This commit is contained in:
Nero 2019-08-14 19:22:54 +02:00
commit 40a2da38a2
7 changed files with 120 additions and 0 deletions

17
FileUpload.php Normal file
View file

@ -0,0 +1,17 @@
<?php
namespace Post;
class FileUpload extends FormField {
protected $file;
protected $error=UPLOAD_ERR_NO_FILE;
public function loadFromEnv($name) {
$this->error=$_FILES[$name]['error'];
$this->value=$_FILES[$name]['name'];
$this->file=$_FILES[$name]['tmp_name'];
}
public function validate() {
return ($this->error==0);
}
}