z-song / laravel-admin

Build a full-featured administrative interface in ten minutes
https://laravel-admin.org
MIT License
11.15k stars 2.82k forks source link

Unable to upload file greater than 10kb #5668

Closed pollyolly closed 2 years ago

pollyolly commented 2 years ago

Description:

I was able to upload smaller file size files but Im unable to upload file greater than 10kb using $form->file() and even after setting php.ini to higher values:

cgi.fix_pathinfo=0
memory_limit=256
max_input_vars=1000
max_file_uploads = 20
upload_max_filesize=10M
post_max_size=10M
max_execution_time=60

I can confirm my php.ini path is correct, pointing to /etc/php/7.4/fpm/php.ini using phpinfo(). My webserver is NginX running this configuration for file upload and web pagesizing:

#nginx
server {
   client_max_body_size 10M;
    location /uploads {
       client_max_body_size 10M;
    }
    location ~ \.php$ { 
       fastcgi_buffers 4 16k;
       fastcgi_buffer_size 16k;
    }
}
#config/filesystem.php
'disks' => [
        'admin' => [
                'driver' =>'local',
                'root' => public_path('uploads'),
                'visibility' =>'public',
                'url' => env('APP_URL').'/uploads',
        ],
        'local' => [
            'driver' => 'local',
            'root' => storage_path('public'),
        ],
        'public' => [
            'driver' => 'local',
            'root' => storage_path('app/public'),
            'url' => env('APP_URL').'/storage',
            'visibility' => 'public',
        ],
        's3' => [
            'driver' => 's3',
            'key' => env('AWS_ACCESS_KEY_ID'),
            'secret' => env('AWS_SECRET_ACCESS_KEY'),
            'region' => env('AWS_DEFAULT_REGION'),
            'bucket' => env('AWS_BUCKET'),
        ],

    ],
#public/.htaccess
php_value upload_max_filesize 10M
php_value post_max_size 10M
php_value memory_limit 256M

Steps To Reproduce: