1

I need to download, from a mobile app developed in flutter 1.22.2, a file generated by a php script. The file is available in blob format. The javascript code in the web page is:

response.blob()
                .then(blob => URL.createObjectURL(blob))
                .then(url => {
                    let a = document.createElement('a');
                    a.href = url;
                    a.download = 'modulo-' + JobRiskIden + '.pdf';
                    a.target = '_blank';
                    document.body.appendChild(a);
                    a.click()
                    a.remove();
                })

Where "response" variable is the response from a fetch to a php page that generates the file. I followed the instructions from this stackoverflow question:

Flutter WebView blob pdf download

The download works fine on iOS but an issue is present on Android (test done with compileSdkVersion 29): when I tap on the download link the debugger prints this message:

{message: Not allowed to load local resource: blob:https://apps.badgebox.com/62edb40f-4407-4d3b-8427-587ea133b778, messageLevel: 3}

Can someone help me to solve this issue?

0 Answers0