zizohassan / laraflat

Advanced laravel system to build admin panel
http://laraflat.com
MIT License
150 stars 76 forks source link

cant upload ["pdf","txt"...] #72

Closed wanteed-lh closed 6 years ago

wanteed-lh commented 6 years ago

capture d ecran 2018-02-02 a 12 40 13 pm

wanteed-lh commented 6 years ago

changer function uploadFileOrMultiUpload in path App\Application\Controllers\Traits\UploadTrait.php cs Intervention\Image package not supported pdf ,txt

protected function uploadFileOrMultiUpload($image , $destinationPath){

        $extension = $image->getClientOriginalExtension();

        $fileName = rand(11111,99999).'_'.time().'.'.$extension;
        if(in_array($extension, allowExtentionsFiles() ) ){

            $image =  $image->move(path($destinationPath), $fileName);
            return $fileName;
        }

        $image  = Image::make($image);
        /*
         * upload resize image
         */
        $image->save(path($destinationPath.DS.$fileName));
        $image->fit(path(env('SMALL_IAMGE_WIDTH')), path(env('SMALL_IAMGE_HEIGHT')));
        $image->save(path(env('SMALL_IMAGE_PATH').DS.$fileName) , path(env('IMAGE_RESLUTION')));
        return $fileName;
    }
zizohassan commented 6 years ago

pull from dev this issues fixed in dev