Read html file inside a zip file


How can I read html file inside a zip file with an iframe?
I upload an animated banner created in Hype as a zip file. I need to create an iframe that read the index.html from that zip for serving ad.

I read this on GitHub forum:
“One solution is uploaded the whole html (a index.html , js, css, images - all needed file must be in the zip file no external reference for security) as a zip file to server. Then current html will has an iframe to reference the uploaded html.”

This is how I use revive adserver to serve html5 at the moment.

I create an iframe but no chance to read the files inside the zip.
How can I do that?


Well it seems it is possible to read a zip file using Hype and PHP.

On the server you need a php file that does the reading with code like this;

    $handle = fopen('zip://', 'r');
    $result = '';
    while (!feof($handle)) {
        $result .= fread($handle, 8192);
    echo $result;
    ?> (686 Bytes)

Along side that the zip file (677 Bytes)
and the exported Hype project that just runs the php file and then displays the result. (92.8 KB)

Two sources for info :smile:


1 Like

Hi Mark,

Thank you for your reply. I will do a test tomorrow and I will let you know how it works.


1 Like