Download files from inside an H5P-Element
Submitted by ACI on Tue, 09/14/2021 - 10:33
Forums:
Hi everyone,
I was wondering if it is possible to include a file (pdf, picture, .zip folder) inside a course presentation, branching scenario or interactive video that my students would be able to download by clicking on it. This could be a sort of infobox.
Thanky for your reply
Best,
Alba
Summary:
download files from an h5p content
BV52
Tue, 09/14/2021 - 18:27
Permalink
Hi Alba,I'm afraid this is
Hi Alba,
I'm afraid this is not possible for any content type.
-BV
cfp
Tue, 09/14/2021 - 22:25
Permalink
It works with an iframe..
Well, it works rather nicely in a column using an iFrame to hold the file you want to download.
https://www.currikistudio.org/activity/180422/shared
Yes, I know support for iframes is being removed but this is another good reason for keeping them. It is, of course, a bit of a faff because there is no supported way of uploading the files and you have to break in to the h5p package by turning it into a zip and back again. Clearly something like this was at one time intended because when putting in the iframes url the instruction is:
Source
URI to external document, or path to document found inside H5P (under /content)
Presumably something similar is intended in the presentation because, when adding a link, you have to select the protocol and one of the options is 'root relative' although this is probably to wherever the h5p is stored rather than within the package itself. Although a quick experiment shows it is possible to add files to the internal content folder in the same way as it is to the iframe module.
Unfortunately, since iframes cannot be added to the presentation and it isn't possible to edit the html directly, it isn't possible to use links with the download attribute. There would either need to be an instruction to right-click or the files could be stored elsewhere that provides a download link.
It is perhaps worth noting that added files in an iframe aren't ported with the copy and paste facility and the exact link to those added files may depend on where the h5p is stored. Consequently the links may need changing if the package were ever downloaded for reuse. My way of finding the link quickly is to copy the URL of image in the column and adapt that url so as to point to wherever the added file will be.
ACI
Thu, 09/16/2021 - 16:19
Permalink
Thank you!
Thank you!
ACI
Thu, 09/16/2021 - 16:19
Permalink
Thanks anyway :)
Thanks anyway :)