cyverse-gis / suas-metadata

Main repository for Calliope project - see Wiki tab above for details
GNU General Public License v3.0
1 stars 2 forks source link

Importing compressed files #37

Open JLHonors opened 5 years ago

JLHonors commented 5 years ago

Add support for importing .zip, .tar, and .tar.gz files. Decide if we want to decompress these files (and instead import their contents) or if we want to allow the user to upload compressed files. Determine how we want to illustrate these files.

JLHonors commented 5 years ago

Got this finished up. It's located in the "compressedImport" branch. Seems to work properly in the small number of cases I tested, which were the following:

Supports ".zip", ".tar", and ".gz" compressed files. Right now on the preview side (right side) of the window, shows a blank thumbnail with the name of the compressed file next to it. Clicking shows nothing. I assume this is desirable behavior, since you can't really "preview" a compressed file.

Note that it is possible for us to use libraries to decompress the archives and reveal their contents to the user. Since whether we should do this was not specified, I went with the more simple implementation. We ought to discuss this further.

JLHonors commented 5 years ago

Things left TODO:

Helpful links for if we want to decompress these files:

JLHonors commented 5 years ago

We decided these files should be decompressed on import. Moving back to In Progress so this change can be made.

JLHonors commented 5 years ago

Just moving to QA for a quick review. More testing, commenting, and polish still need to be done. Same branch as before: "compressedImport".

TODO:

Tested on an empty zip file, a zip file with a non-image file, and a zip file with two sub-folders that had valid files. All produce the desired results, except the aforementioned lingering parent directory of invalid imports.