Initial commit
This commit is contained in:
commit
40a2da38a2
7 changed files with 120 additions and 0 deletions
17
FileUpload.php
Normal file
17
FileUpload.php
Normal 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);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue