Drag&Drop or file input element support in Browsers #526
-
Hello, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
The general approach would be to assemble a JSONDocument object containing:
Or if you have a Those methods could be used to support drag-and-drop (I've implemented an example here), or to support any other source the I/O classes don't handle out of the box like websockets, complex authentication, database connections, etc. |
Beta Was this translation helpful? Give feedback.
-
Thank you for your quick response! |
Beta Was this translation helpful? Give feedback.
The general approach would be to assemble a JSONDocument object containing:
.json
property (.gltf
JSON content).resources
property (mapping URLs/paths to binary Uint8Array objects)Or if you have a
.glb
you can, invokeio.readBinary(glb)
on the Uint8Array directly.Those methods could be used to support drag-and-drop (I've implemented an example here), or to support any other source the I/O classes don't handle out of the box like websockets, complex authentication, database connections, etc.