Save GIF or Image in the App on clicking it

  1. 2 years ago

    Hello, I have an animated gifs website that I would like to turn into an app for android, I tried to implement the app with apk builder, works well but has a flaw, holding your finger on an animated gif does not allow you to save it on your device and then to share it, I'm interested in buying the pro version of apk builder but I need this new feature, I would be grateful if in the next release was implemented, thanks a lot and good work :-)

  2. admin

    8 Jan 2018 Administrator

    Yes, You can surely implement this feature with JavaScript.

  3. you have to force the download from your php script, like this:

    <?php
    ob_start();
    $filename=$_GET["fn"];
    if( !is_file($filename) ) die("File is missing...\n");
    $mime = ($mime = getimagesize($filename)) ? $mime['mime'] : $mime;
    header("Expires: 0");
    header("Pragma: public");
    header("Content-type: " . $mime);
    header("Content-Length: ".filesize($filename));
    header("Content-Disposition: attachment; filename=".basename($filename));
    header("Content-Transfer-Encoding: binary");
    header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
    readfile("$filename");
    ob_end_flush();
    ?>
    save this file as download.php
    then your link will be:
    <a href="download.php?fn=my_image.jpg">DOWNLOAD IMAGE</a>

    i've done it in webapp and with website2apk v3.1 works great :)

 

or Sign Up to reply!