Kode / Kha

Ultra-portable, high performance, open source multimedia framework.
http://kha.tech
zlib License
1.49k stars 174 forks source link

[feature request] notifyOnDropFiles with file #1321

Open lublak opened 3 years ago

lublak commented 3 years ago

Is your feature request related to a problem? Please describe. Currently there is no way to get the dropped file with html5. Only the name of the file. (notifyOnDropFiles)

Describe the solution you'd like Perhaps this can be realised with assets, so you would actually only have to adapt html5. notifyOnDropFiles stores the file stream internally in a map. Also, instead of just the file name, it gives "drop://filename". If Assets.loadBlobFromPath gets a path with drop:// it will be loaded from the map.

Describe alternatives you've considered Currently a custom drop handling function in native js.

RobDangerous commented 3 years ago

It's not something I'll work on myself (features for use in something like producivity applications are not a priority for me) but I'll happily take pull requests.

lublak commented 3 years ago

@RobDangerous done :P https://github.com/Kode/Kha/pull/1322

lublak commented 3 years ago

@ myself Currently implemented in kha_debug_html5. Just add if(file.startsWith("drop://")) to html5 and test it.