/**
  * Dosyaları yükler
  *
  * @return array
  */
 public function upload()
 {
     $files = $this->getFiles();
     $response = [];
     $types = new ImageUploadTypes();
     foreach ($files as $file) {
         if (!$file instanceof ImageUpload) {
             $file = new ImageUpload($file);
             $file->setAllowedMimeTypes($types->getImageMimeTypes());
             $file->setAllowedExt($types->getImageTypeExt(), ['.php']);
         }
         $response[] = $file->upload();
     }
     return $response;
 }
Example #2
0
<?php

include '../vendor/autoload.php';
use Anonym\Components\Upload\ImageUpload;
$upload = new ImageUpload($_FILES['file'], 'upload');
$upload->upload();