Skip to main content
4 of 4
edited tags
avpaderno
  • 97.9k
  • 15
  • 164
  • 284

Unable to install the “H5P.Scorm.h5p” library: “The uploaded file was not a valid h5p package”

Thanks to jackrabbithanna’s help on this other question I seem to be 1/2 way to getting H5P related libraries installed in my Drupal 7.59 install. I am attempting this on macOS High Sierra under MAMP 4.5 (PHP 7.1.12) and MAMP 3.5.2 (PHP 5.6.10).

But like I said, I am 1/2 way there; not fully there. I am able to get the H5PEditor.ScormFile (1.0.8) library installed, but not H5P.Scorm (1.1.16).

The libraries in question are as follows:

To help this process, I have now devised a bit of a Bash scripting process to get the h5p packages built from the source GitHub repos. Here is what I do…

The H5PEditor.ScormFile (1.0.8) Bash dance:

cd ~/Desktop/

git clone https://github.com/pavloshevchuk/h5p-editor-scorm 

cd ~/Desktop/h5p-editor-scorm

find . -type f \( -name '.DS_Store' -o -name '.gitignore' -o -name 'LICENSE' -o -name 'README.md' \) -exec rm {} \;
find . -type d -name '.git' -exec rm -rf {} \;

mkdir H5PEditor.ScormFile && mv {scripts,styles,*.json} H5PEditor.ScormFile

echo '{
  "title": "H5PEditor.ScormFile",
  "language": "en",
  "author": "Pavlo Shevchuk",
  "license": "cc-by-sa",
  "preloadedDependencies": [
    {
      "machineName": "H5PEditor.ScormFile",
      "majorVersion": 1,
      "minorVersion": 0,
      "patchVersion": 8
    }
  ],
  "mainLibrary": "H5PEditor.ScormFile",
}' > h5p.json

zip -r ../H5PEditor.ScormFile.h5p *

The H5P.Scorm (1.1.16) Bash dance:

cd ~/Desktop/

git clone https://github.com/pavloshevchuk/h5p-scorm

cd ~/Desktop/h5p-scorm

find . -type f \( -name '.DS_Store' -o -name '.gitignore' -o -name 'LICENSE' -o -name 'README.md' \) -exec rm {} \;
find . -type d -name '.git' -exec rm -rf {} \;

mkdir H5P.Scorm && mv {css,js,*.json} H5P.Scorm
mkdir content && mv icon.svg content

echo '{
  "title": "SCORM/xAPI",
  "language": "en",
  "license": "cc-by-sa",
  "preloadedDependencies": [
    {
      "machineName": "H5P.Scorm",
      "majorVersion": 1,
      "minorVersion": 1,
      "patchVersion": 16
    }
  ],
  "mainLibrary": "H5P.Scorm",
  "embedTypes": [
    "div"
  ]
}' > h5p.json

zip -r ../H5P.Scorm.h5p *

And with those two things done I now have two H5P files ready to go: H5PEditor.ScormFile.h5p and H5PEditor.ScormFile.h5p.

But while installing H5PEditor.ScormFile.h5p proceeds as expected, the same can’t be said for H5PEditor.ScormFile.h5p. I get the following Drupal system information message:

For security reasons, your upload has been renamed to H5P.Scorm_.h5p.

Followed by this “great news”:

The uploaded file was not a valid h5p package

Screenshot attached below. Any insight is appreciated.

Screensnot of the “H5P.Scorm.h5p” library failing to install as expected.

Giacomo1968
  • 273
  • 1
  • 10