I'm sorry I feel I am being a bit of a bore on this issue. I promise this will be my last comment on it. I really don't want to waste people's valuable time but at the same time I feel frustrated because I am still trying to understand the objections to my idea and I feel we may be making a mistake in how we consider the difference between the filepicker and filemanager. I am still worried I may not have got my point across. So let me get this off my chest so I can get on with coding.
I really don't see why duplicating what the filepicker already does in the filemanager is a good idea. The filepicker is a great interface to pick one file. If we are dealing with one file it doesn't need to be 'managed'. As I have said I think the one file case is very common so it bares some consideration.
Does anyone disagree that the filepicker is a better interface for picking one file? It is optimally simple and was designed to be similar to the single file uploader element that users are familiar with.
How does duplicating functionality help with security and maintainability of code?
The actual difference between the functionality of the two form elements is just how many files they deal with. They both deal with files in the draft files area. When there is an existing file the filepicker can already handle the display of an existing file.
The code for copying the files to the draft area and merging files from the draft area back to the plug in files area is separate to the form elements themselves. This code can already be used with the filepicker element as well as the filemanager element, I think it can probably be used as is.
The I think very elegant system for file upload to a plug in files area I understand as follows :
1. Populate form by preparing a draft files area with a full set of copies of file records for the files in the plug in files area.
2. User is allowed to manage files in draft files area.
3. Changes in files in draft files area is merged back into the plug in files area.
Using the file picker we always should end up with exactly one file in the draft file area and if the code written for steps 1 and 3 that manages the populating of files in the file area and merging changes back into plug in files area is working properly it should not matter which form element we use for 2, either the filemanager to manage multiple files or the filepicker to pick one file.