Open data:image/gif;base64 in Safari

How I can open "data:image/gif" in Safari by pressing button??

Swift 3.0

For example take this gif image: data:image/gif;base64,R0lGODdhMAAwAPAAAAAAAP///ywAAAAAMAAw%0AAAAC8IyPqcvt3wCcDkiLc7C0qwyGHhSWpjQu5yqmCYsapyuvUUlvONmOZtfzgFz%0AByTB10QgxOR0TqBQejhRNzOfkVJ+5YiUqrXF5Y5lKh/DeuNcP5yLWGsEbtLiOSp%0Aa/TPg7JpJHxyendzWTBfX0cxOnKPjgBzi4diinWGdkF8kjdfnycQZXZeYGejmJl%0AZeGl9i2icVqaNVailT6F5iJ90m6mvuTS4OK05M0vDk0Q4XUtwvKOzrcd3iq9uis%0AF81M1OIcR7lEewwcLp7tuNNkM3uNna3F2JQFo97Vriy/Xl4/f1cf5VWzXyym7PH%0Ahhx4dbgYKAAA7


Please help and explain me how to make it. I am newbie.

Replies

The normal way to open a URL in Safari is via

UIApplication.open(_:options:completionHandler:)
(or the older
openURL(_:)
). However, this does not work for
data:
URLs because Safari doesn’t claim them.

OTOH, there are other ways to present GIF data, either in a web view (WKWebView) or, unless you need the whole web view, in an image view. Do you really need to show this in Safari?

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"
  • can we open data:text/html; in Safari ?

Add a Comment
<a class="btn bg-gradient-dark mb-0" download="<?php echo "UETDS $psfname.pdf"; ?>" id=""><i class="material-icons text-sm">picture_as_pdf</i>&nbsp;&nbsp;PDF</a>
                 
                <script>
$("#uetdspdfver").ready(function(){
    var uetdSeferReferansNo = <?php echo $uetdSeferReferansNo; ?>;
      $.ajax({
        url:"UETDS.php",
        type: "POST",
        data:{
            'pdfuetdSeferReferansNo':uetdSeferReferansNo
        },
        success: function(result){
          document.getElementById("uetdspdfver").href="data:application/pdf;base64,"+result;
        }
    });

});
</script>

I want download pdf document in Safari But not download pls help me