Hacker News new | ask | show | jobs
by bhanu423 3313 days ago
How to solve the issues above: Just listen to 'ondrop' event on body and store the path of the file and call event.preventDefault() to prevent the file loading. Now I think all of your issues are solved:

>1: You can now filter the extensions as per your requirements

>2: Now you can load the file separately and verify the content as per your satisfaction using the fs module available in electron

>3: You can use: ondragover and ondragend events to facilitate ui feedback

>4: Not sure what you mean by file drag, but I cannot think of anything that cannot be implemented here.

>5: Not sure what do you want here.

>6: Not inbuilt but can be built easily.

Editors like atom and vscode have very good file-drop functionality and have image viewer apart from many other goodies. Depending on your familiarity with js, these things are more or less trivial to implement. Github team must have a different feature-set in mind that unfortunately didn't had drag and drop functionality for their first release. If anyone really wants the feature, the better way is to leave a feedback in app or open a issue (not sure if either exists).