PHP code example of cakedc / cakephp-uppy

1. Go to this page and download the library: Download cakedc/cakephp-uppy library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

cakedc / cakephp-uppy example snippets


return [
    'Uppy' => [
        'driver' => 's3', // 's3' | 'gcs' | 'r2'
        'routes' => true, // Register the /uppy/* routes (default true)
        'MaxFileSize' => null, // Maximum file size in bytes, null = no limit
        'MultipartThreshold' => 104857600, // 100 MiB - use multipart for files above this size
        'AcceptedContentTypes' => ['application/pdf', 'image/png', ...],
        'AcceptedExtensions' => ['pdf', 'png', ...],
        'S3' => [
            'constants' => [
                'lifeTimeGetObject' => '+20 minutes',
                'lifeTimePutObject' => '+5 minutes',
                'lifeTimeUploadPart' => '+20 minutes',
            ],
            'config' => [
                'version' => 'latest',
                'region' => env('S3_REGION'),
                'use_path_style_endpoint' => (bool)env('S3_USE_PATH_STYLE_ENDPOINT', false),
                'credentials' => [
                    'key' => env('S3_KEY'),
                    'secret' => env('S3_SECRET'),
                ],
            ],
            'bucket' => env('S3_BUCKET'),
        ],
    ],
];