Quantcast
Channel: Active questions tagged https - Stack Overflow
Viewing all articles
Browse latest Browse all 1633

Downloading corrupted files from url with flutter web

$
0
0

I am developing a web app with Flutter (web) and I need to download a file (of any type of extension) via a URL, DOWNLOAD it and not open it through the browser.The problem is that using this code, it does download the file but it seems to be corrupted.

String downloadFile(String filename) {    String? url= 'https://www.xxxxxx.it/yyyy/zzzz'+'/'+filename;        var ciao = html.Url.createObjectUrlFromBlob(html.Blob([url]));        html.AnchorElement(href: ciao)          ..setAttribute('download', filename)          ..click();    return "File "+filename+" in download!";  }

enter image description here

enter image description here

enter image description here


Viewing all articles
Browse latest Browse all 1633

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>