0

It works when I upload files around 2MB, but error when I upload 2+MB files I have an application based on Laravel 5 with file upload functionality. 1. I try to insert images(jpeg,bmp,png) and files(Docx,xlsx,pdf) so Everything works fine when the size is arround 2MB but error when I upload 20+MB files Anyone know where the error?

my code

 public function rules()
{
    return [
        'proposition' => 'required',

    ];
    $filename = count($this->input('filename'));
    foreach(range(0, $filename) as $index) {
        $rules['filename.' . $index] = 'required|mimes:pdf,jpeg,bmp,png,doc,docx,csv,xlsx|max:20000';

    }
    return $rules;
}

my function

    public function store(PropositionRequest $request)
     {
    $proposition = new Proposition();
    $prop = Proposition::create($request->all());
    $prop->saveTags($request->get('tags'));
    foreach ($request->filename as $filename) {
        var_dump($filename);

        $filename = $filename->store('filename');
        PropositionFiles::create([
            'proposition_id' => $prop->num_proposition,
            'filename' => $filename
        ]);
    }
Mira
  • 1
  • 1
  • 6
  • 2
    Possible duplicate of [PHP change the maximum upload file size](http://stackoverflow.com/questions/2184513/php-change-the-maximum-upload-file-size) – Raymond Nijland May 11 '17 at 14:43
  • 1
    Tell us the difference from http://stackoverflow.com/questions/43914591/how-to-upload-some-file-pdf-using-laravel? – u_mulder May 11 '17 at 14:44
  • The default upload limit is 2mb, hence the behavior you are seeing. – Jeremy Harris May 11 '17 at 14:44
  • i change th upload_max_filesize to 100 MB but it still desn't work .. with the same error , FileNotFoundException in MimeTypeGuesser.php line 123: The file "" does not exist – Mira May 11 '17 at 14:54
  • in addition to upload_max_filesize... also change post_max_size – Dug May 11 '17 at 14:59
  • i chage it too and nothing happened .. the same error :( – Mira May 11 '17 at 15:04

0 Answers0