advanced-rest-client / arc-electron

Advanced REST Client - Desktop application
Other
1.42k stars 224 forks source link

Drag and drop import does not work on Windows 10 #173

Closed ullgren closed 5 years ago

ullgren commented 5 years ago

Expected Behavior

Importing a RAML zip file downloaded from Exchange would be imported when dragged and dropped to the left pane of the "APIs" view. This works as expected when doing the same with the exact same ZIP file on Linux (Ubuntu 18.04)

Actual behavior

On Windows, when the file is dropped a toaster message showing the text "Unkown file format" appears. Nothing is imported.

To Reproduce

Screenshots

drag-n-drop-import-windows-10.zip

Additional Information

Importing the same API by using the "Explore" option works. However the real-world scenario is that we have a RAML in a private exchange on the EU Control Plane and we use federated users so we can unfortunately not use "Explore".

jarrodek commented 5 years ago

Hi.

Sorry for late response. I was on vacations and just came back. I will take a look into this shortly.

jarrodek commented 5 years ago

Note to myself: Windows sets application/x-zip-compressed mime on type property of a file when dropping a zip file. This should be added to the list of zip mime types: https://github.com/advanced-rest-client/arc-data-import/blob/3.0.0-preview/arc-data-import.js#L425 Alternatively the script could read first few bytes and test for ZIP header however this would require reading a file twice in some situations.