Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Uploader {
- public $field;
- public function __construct ($field) {
- $this->field = $field;
- }
- public function isUploaded() {
- return isset($_FILES [$this->field]) && (0 == $_FILES [$this->field]['error']);
- }
- public function upload() {
- if ( $this->public function isUploaded() ) {
- move_uploaded_file(
- $_FILES [$this->field]['tmp_name'],
- __DIR__ . '/images/uploaded.jpeg'
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement