filepond icon indicating copy to clipboard operation
filepond copied to clipboard

If multiple files allowed don't automatically allow selection of multiple files on file system

Open wangyi7099 opened this issue 5 years ago • 13 comments

I see this function: https://github.com/pqina/filepond/blob/575403aca51a707de76894a8abfd22a1e37cba59/dist/filepond.js#L2481

Why should we junge this? It seems that allowMultiple has no relationshiip with max-files property. allowMultiple should just mean we can choose multi files in the opened file dialog.

wangyi7099 avatar Nov 26 '18 07:11 wangyi7099

I have no idea what you mean, please elaborate.

rikschennink avatar Nov 29 '18 06:11 rikschennink

In a word, I think we should remove this judgement: https://github.com/pqina/filepond/blob/575403aca51a707de76894a8abfd22a1e37cba59/dist/filepond.js#L2481

Suppose there is such a scenario:

I want to limit to choose single file rather than multi files in the opened file dialog, and I also want to upload more than files to the server. If this judgement exists, I can only upload one file to server,.

wangyi7099 avatar Nov 29 '18 07:11 wangyi7099

So you want to allow customers to:

  • only add one file at once;
  • have more than one file in the list;

If that's correct, can you tell me why you want your customers to only select one file instead of multiple?

rikschennink avatar Dec 01 '18 12:12 rikschennink

Well, Assume we enabled the multiple and we use it on mobile, the file type we upload is jpg and the files's name is generated by Guid. We only allow to upload 3 files. But if we choose file 5 files, only 3 of them are left and we don't know which 3 files of them. Because the file name is UID and it is a random series of string.

wangyi7099 avatar Dec 01 '18 12:12 wangyi7099

If I understand correctly you mean:

  • The user selects five files in the browse panel
  • You don't know which files were selected

I think you have to assume the browser returns the first 3 right?

rikschennink avatar Dec 03 '18 08:12 rikschennink

Yes. But I don't know whether first 3 or the random 3 files...

wangyi7099 avatar Dec 03 '18 08:12 wangyi7099

The files are handled by FilePond in the order that the browser returns them.

Why does it matter?

rikschennink avatar Dec 03 '18 08:12 rikschennink

The users don't know they are first 3 files, the only thing they can see are the random uid names of pictures.

wangyi7099 avatar Dec 03 '18 08:12 wangyi7099

Aha! Now I get it. :-)

Can you add the image preview plugin to solve this?

rikschennink avatar Dec 03 '18 08:12 rikschennink

We are not allowed to use image preview plugin. :(

wangyi7099 avatar Dec 03 '18 08:12 wangyi7099

Why not if I may ask?

rikschennink avatar Dec 03 '18 09:12 rikschennink

Because the pm thinks the pic in plugin preview is ether too big and cannot be seen entirely or too small. And we don't want to specify width/height for each picture that user upload.

wangyi7099 avatar Dec 03 '18 09:12 wangyi7099

Alright 👍

rikschennink avatar Dec 03 '18 09:12 rikschennink