-
Recipe: how to upload multiple documents in Javascript using drag&drop
Problem: when dragging multiple documents from operating system you get a pDragValue List with one line per document. If you use $clientcommand to read every file in a loop the corresponding call to $filereadcomplete is only executed once.
Solution:
1. in on evDrop use instance var iDragList to save pDragValue and call $readnext
2. new method $readnext (client executed) reads the current file in iDragList using $clientcommand(“readfile”) and increments the current line
3. $filereadcomplete adds the file to a iFileList and calls $readnext
dropFilesHere Button or other element with dropmode kAcceptOperatingSystem
On evDrop
If pDragType=kDragOperatingSystem
Calculate iDragList as pDragValue
Do $cinst.$readnext()
End If
Log in to reply.