Advertisement
SashaRaaa

Untitled

Jul 18th, 2018
353
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.41 KB | None | 0 0
  1. class Uploader {
  2.  
  3. public $field;
  4.  
  5. public function __construct ($field) {
  6.     $this->field = $field;
  7. }
  8.  
  9. public function isUploaded() {
  10.  
  11. return isset($_FILES [$this->field]) && (0 == $_FILES [$this->field]['error']);
  12.      }
  13.      
  14. public function upload() {
  15.     if ( $this->public function isUploaded() ) {
  16.     move_uploaded_file(
  17.     $_FILES [$this->field]['tmp_name'],
  18.     __DIR__ . '/images/uploaded.jpeg'
  19.     );
  20.    
  21.     }
  22.  
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement