Sopamo / laravel-filepond

Laravel backend module for filepond uploads
MIT License
202 stars 56 forks source link

Input only has 1 file #56

Closed interludic closed 2 years ago

interludic commented 2 years ago

Hello!

How do i get multiple files?

this is working fine, $filepond = app(\Sopamo\LaravelFilepond\Filepond::class); $path = $filepond->getPathFromServerId($input['file']); dd($path);

        $('.upload-filepond{{$class??''}}').filepond('onprocessfile', function(e, file) {        
            console.log(e);
            console.log(file.serverId);

returns the following (for both files!??) eyJpdiI6IjlNREswWEZ0MHlRenMwZU1RR3NVZ3c9PSIsInZhbHVlIjoiL2pkaGRPYktzcGlSdHlOSER3dnR3UUIzelA2anVyVnlBcUp5cXlBaDhzUWVyTWd2bHJycjZhVzFyTmRkZlJaV3BWMkhnSXphai9CdlhVb1YwNG5LVllSNFJ1dno3YS85NWd4bzJYc1plWlZpY0s4QTNLTWJDNXpINHR5NFlvc2MiLCJtYWMiOiJkODc1ODE0YjJhMDdiZWRkZmZjOTY2ZjhkMTc3ZWE5ZDNlODUxMjE1N2Y1YjZjYmQ1MjZiNzg2NzZjNTE5OWYxIn0=

What am i missing?

interludic commented 2 years ago
<input type="file" class="upload-filepond{{$class??''}}" name="file" multiple 
    data-allow-reorder="true"
    data-max-file-size="3MB"
    data-max-files="3" 
    accept="image/png, image/jpeg" 
/>

and

allowMultiple: true,

interludic commented 2 years ago

It seems it's not possible?

looking at FilepondController $file = is_array($input) ? $input[0] : $input;

the input is hardcoded to only the first item???

interludic commented 2 years ago

Nope looks to be working fine my bad!