Multiple document selection in Cases EditView

In Cases module -> editView, there is an option to update attachments. Here we can upload 1 file at once. I wanted to modify it so that users can select multiple files at once.

I changed the form in modules/AOP_Case_Updates/tpl/caseUpdateForm.tpl
(For External Files) Input field -> case_update_file[] -> added attribute multiple

        <input type="file" id="case_update_file[]" name="case_update_file[]" multiple>

(For Internal Document Files) Button -> btn_case_document_name -> onclick -> open_popup -> changed parameter single to multiple.

                                "multiselect",  // was single before 

External files seem to work fine. But internal document selection isn’t working.
When I select multiple files (through checkboxes) in the popup and click the select button, it doesn’t return anything. Whereas it works when I select a single file (clicked a single name, not through checkbox)

Also, how do I make it upgrade-safe?

Thanks in advance.