Notice: Trying to get property 'post_parent' of non-object in /var/www/html/community/wp-content/plugins/buddyboss-platform/bp-forums/functions.php on line 841
Recipe: how to upload multiple documents in Javascript using drag&drop - Omnis General Forum - Omnis Forum

Forums

Find answers, ask questions, and connect with our
community all around the world.

Home Forum Omnis General Forum Recipe: how to upload multiple documents in Javascript using drag&drop

  • Recipe: how to upload multiple documents in Javascript using drag&drop

    Posted by Christoph Schwerdtner on November 8, 2022 at 8:24 am

    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

    Christoph Schwerdtner replied 2 weeks, 5 days ago 1 Member · 1 Reply
  • 1 Reply

Notice: Trying to get property 'post_parent' of non-object in /var/www/html/community/wp-content/plugins/buddyboss-platform/bp-forums/functions.php on line 841
  • Christoph Schwerdtner

    Member
    November 8, 2022 at 8:35 am

    continued…

    $readnext (client executed)

    If iDragList.$line<iDragList.$linecount
    Calculate iDragList.$line as iDragList.$line+1
    Do $cinst.$clientcommand("readfile",row(iDragList.c4,"iFileObject",1))
    Else
    Do iDragList.$clear()
    End If

    $filereadcomplete (client executed)

    Do iFileList.$add(pIdent,iFileObject,iDragList.c1)
    Do $cinst.$readnext()

Log in to reply.