File for download

Hi there,

I believe I saw this somewhere, or maybe I wrote a request before. It is highly needed to have special in mathematics classrooms where students learn an activity and can download a file for practice. I really hope it could be shared here. Thanks in advance!!


Supporter votes Members of the Supporter Network can vote for feature requests. When the supporter network has generated sufficient funding for the top voted feature request it will normally be implemented and released. More about the H5P Supporter Network
otacke's picture

Done before you even asked ;-)

Thank you so much Oliver.. This is really good!!

Hi Oliver,

Small question, does the file download work for pdf and doc files, as sometimes there is a need for that in higher grades to consolidate the learning or will it only work for images? I am also having a litte trouble making it work, I ran both npm install, npm run build but unable to save files as suggested. I have added the File-for-download library to the content builder to allow me to save files with other content.



otacke's picture


You will also need to pack the files into an H5P library, see will not give support for that content type. It was contract work, and I don't want to play a role in keeping "PDF dispensers" alive.

Any file type (extension) that is enabled in the H5P integration should work. PDF, DOC, DOCX and others are among those by default.


That is totally fair, I ran into this error while install 

That is totally fair, I ran into this error while install 

otacke's picture

And have you looked at the potential output above of what you show in the image or at the log that is hinted to?

Yes, it is very similar to the image above:

16 verbose Linux 3.10.0-1160.90.1.el7.x86_64

17 verbose argv "/usr/bin/node" "/bin/npm" "run" "build"

18 verbose node v12.22.12

19 verbose npm  v6.14.16

20 error code ELIFECYCLE

21 error errno 1

22 error [email protected] build: `webpack --mode=production`

22 error Exit status 1

23 error Failed at the [email protected] build script.

23 error This is probably not a problem with npm. There is likely additional logging output above.

24 verbose exit [ 1, true ]

otacke's picture

You're using ancient versions of node.js (current is 18/20) and npm (current is 9). The former is most likely the issue.

You are correct!! Thank you very much!!