question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Download of a blob url doesn't work on Android

See original GitHub issue

Bug description: I’m generating a blob URL of an audio and putting it into a link tag <a> with the download attr. It works well on the browser, but when I click the link on the React Native Webview nothing happens (no errors).

I thought that it was a permission problem, so I added the WRITE_EXTERNAL_STORAGE to AndroidManifest and requested the permission when the app starts, but it didn’t work.

To Reproduce:

// Create a blob URL and pass it to a link tag
// Try to download the audio on the Webview
const blob = new Blob([], { type: 'audio/webm' })
const url = URL.createObjectURL(blob)

<a href={url} download="audio.mp3">Click to Download</a>

Expected behavior: The audio must be downloaded to the user’s phone.

Screenshots/Videos: App.tsx image

AndroidManifest.xml image

Environment:

  • react-native version: 0.67.4
  • react-native-webview version: 11.17.2

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:3
  • Comments:5

github_iconTop GitHub Comments

1reaction
medeirosrafaelcommented, Oct 14, 2022

Did you solve it, @LuanEdCosta ?

0reactions
xsorrencommented, Nov 7, 2022

+1 pls helppp

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to download blob url in webview - android - Stack Overflow
i used this code in my project and is worked for me, try it! and don't forget to add this code to onCreateView...
Read more >
JS blob download button dosent work on android or IOS
Solution: Here's an answer to a similar question:https://stackoverflow.com/questions/15293694/blob-constructor-browser-compatibilityIt ...
Read more >
ultimatewebview downloading error | B4X Programming Forum
Only problem i am facing is downloading the files (Excel and pdf Files) ... Download Blob file from Website inside Android WebViewClient
Read more >
Fix file download errors - Google Chrome Help
If you receive an error message on Chrome when you try to download apps, themes, extensions or other files, try these fixes. Fix...
Read more >
7 Quick Solutions to Download Blob Videos (Tested and Free)
Open a blob video. Right-click the page. Choose "Inspect". In the "Element" tab, Ctrl + F and search the keyword "blob ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found