Support the ongoing development of Laravel.io →
Input Testing Configuration
Last updated 7 months 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!

Cloudways

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.

© 2022 Laravel.io - All rights reserved.