filepond
filepond copied to clipboard
If multiple files allowed don't automatically allow selection of multiple files on file system
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.
I have no idea what you mean, please elaborate.
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,.
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?
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.
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?
Yes. But I don't know whether first 3 or the random 3 files...
The files are handled by FilePond in the order that the browser returns them.
Why does it matter?
The users don't know they are first 3 files, the only thing they can see are the random uid
names of pictures.
Aha! Now I get it. :-)
Can you add the image preview plugin to solve this?
We are not allowed to use image preview plugin. :(
Why not if I may ask?
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.
Alright 👍