If you drag 5 documents onto a control, the dataURLArray
is generated in a non-specific order, often leading to it being in a different order to the fileArray
, this is bad since the data URL contains no identifying data about the file apart from type.
As an example, if I attach 4 .docx
files and a .msg
to a control:
The types of the files in fileArray
in the order the array is in:
[
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
"",
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
"application/vnd.openxmlformats-officedocument.wordprocessingml.document"
]
The start of the dataURLArray objects:
[
"data:application/vnd.openxmlformats-officedocument.wordprocessingml.document;base64,UEsDBBQABgAIAAAAIQCshlBXjgEAA...",
"data:;base64,0M8R4KGxGuEAAAAAAAAAAAAAAAAAAAAAPgADAP7/CQAGAAAAAAAAAAAAAAABAAAAAgAAAAAAAAAAEAAAEgAAAAIAAAD+////AAA...",
"data:application/vnd.openxmlformats-officedocument.wordprocessingml.document;base64,UEsDBBQABgAIAAAAIQCshlBXjgEA...",
"data:application/vnd.openxmlformats-officedocument.wordprocessingml.document;base64,UEsDBBQABgAIAAAAIQCshlBXjgEA...",
"data:application/vnd.openxmlformats-officedocument.wordprocessingml.document;base64,UEsDBBQABgAIAAAAIQBhd9IpggEA..."
]
As you can clearly see they're in a different order, and there is a high chance the .docx
files are in the wrong order.
This is an issue for me as I am using the base64 component of the data URL to upload these files to the server with the data from the fileArray
, which cannot be matched up if uploading more than one file.