v2.5.2
Giriş yap

Laravel dosya yükleme hatası

rotaile
576 defa görüntülendi ve 1 kişi tarafından değerlendirildi

arkadaşlar 1mb aşağısı fotoğraflarda sorun yok ama 7 8 mb lik bir fotoğraf seçince bu şekilde bir hata alıyorum. githubda bir paylaşım yapılmış ama sorun çözülmedi nedeni nedir?

Illuminate \ Foundation \ Http \ Middleware \ ValidatePostSize: 24handle

<?php

namespace Illuminate\Foundation\Http\Middleware;

use Closure;
use Illuminate\Http\Exceptions\PostTooLargeException;

class ValidatePostSize
{
    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     *
     * @throws \Illuminate\Http\Exceptions\PostTooLargeException
     */
    public function handle($request, Closure $next)
    {
        $max = $this->getPostMaxSize();
        // ******* HATA BU IF SATIRINDA **********    
        if ($max > 0 && $request->server('CONTENT_LENGTH') > $max) {
            throw new PostTooLargeException;
        }

        return $next($request);
    }

    /**
     * Determine the server 'post_max_size' as bytes.
     *
     * @return int
     */
    protected function getPostMaxSize()
    {
        if (is_numeric($postMaxSize = ini_get('post_max_size'))) {
            return (int) $postMaxSize;
        }

        $metric = strtoupper(substr($postMaxSize, -1));
        $postMaxSize = (int) $postMaxSize;

        return match ($metric) {
            'K' => $postMaxSize * 1024,
            'M' => $postMaxSize * 1048576,
            'G' => $postMaxSize * 1073741824,
            default => $postMaxSize,
        };
    }
}
?>
Cevap yaz
Cevaplar (2)
rotaile
693 gün önce

[PHP]
post_max_size = 100M
upload_max_filesize = 100M
variables_order = EGPCS

php ini dosyasının içi bu şekkilde. fakat yinede yüklenmiyor

mubado
694 gün önce

php ini dosyasından değiştirmelisin. Max uploadını