Problem uploading re-zipped package
Submitted by cfp on Thu, 09/09/2021 - 13:49
Forums:
I'm just starting out thinking about developing but am falling at the very first hurdle. I wanted a quick look inside an H5P package just to get a feel for the territory. Now, here's the thing..
- I created a simple activity in the normal way and exported the H5P file.
- I changed the H5P suffix to zip and unzipped.
- Without changing a thing I rezipped the contents, i.e. not the folder that was created by unzipping but the contents of that folder.
- Changed the suffix back to H5P
- Tried to upload the activity...and it failed.
I tried uploading to a local installation and to an online installation. The package was rejected. I'm using a mac so used the normal right click to compress and decompress but when that didn't work I also tried WinZip. I wondered if it was a particular Mac problem so this time
- I created a simple activity in the normal way and exported the H5P file.
- I uploaded it as a file to my moodle installation, i.e. just as a file activity not as an H5P activity.
- Online within Moodle changed the suffix to zip and unzipped the file online.
- Deleted the zip file leaving me with just the unzipped contents.
- Selected all the files and downloaded, whereupon they were downloaded as a zip archive.
- Changed the suffix of the downloaded archive to H5P
- Tried to upload the activity...and it failed.
Am I missing something obvious?
otacke
Thu, 09/09/2021 - 22:52
Permalink
Hi! If you manually zip files
Hi!
If you manually zip files, make sure to use the required flags: -D (do not add directory entries) and -X (eXclude eXtra file attributes), e.g. as:
H5P expects those flags to be set. BUT zipping manually to create H5P libraries is not recommended anyway. That's what the H5P CLI tool is there for.
Best,
Oliver
cfp
Thu, 09/09/2021 - 23:16
Permalink
Thank you.
Thanks, yes, that's helpful. I had tried half a dozen different ways, a couple locally and several online (as I have discovered Macs don't normally play nicely with zip files). All were failing. Just as I found your reply I did find another way that worked so, in case any other Mac users run into the same issue, what worked for me was using izip which enables you to open a zip file as if it is any other removable drive.
otacke
Fri, 09/10/2021 - 00:34
Permalink
Building H5P libraries is
Building H5P libraries is about more than zipping. I really recommend to familiarize yourself with the H5P CLI tool.