Support the ongoing development of Laravel.io →
Input Testing Configuration
Last updated 1 year ago.
0

I happen to have solved the problem.. issue was with how you make a call when one key can have more than one item.

I though that you would define the name i.e. file[] and than you attach files to it, which was wrong.

Correct way of make such calls is : file => [$file1, $file2]

Below is updated method

$datafile = new \Symfony\Component\HttpFoundation\File\UploadedFile(
            base_path('tests/files/File1.csv'), 'File1.csv', 'text/csv', 13071, null, false
    );  

    $files = ['file' => [$datafile]];

    $response = $this>call(
            'POST', # $method
            '/user/files/uploadFiles', # $action 
            $values, # $parameters 
            [],
            $files
    );
0

Sign in to participate in this thread!

Eventy

Your banner here too?

spikerok spikerok Joined 23 Sep 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.