initial
This commit is contained in:
commit
74ae93a96e
1 changed files with 94691 additions and 0 deletions
|
|
@ -0,0 +1,25 @@
|
|||
blob file download
|
||||
|
||||
```jsx
|
||||
const download=()=>{
|
||||
fetch(`${HOST}`,{
|
||||
|
||||
})
|
||||
.then(res=>res.blob())
|
||||
.then(blob=>{
|
||||
const url = URL.createObjectURL(blob);
|
||||
const link = document.createElement("a");
|
||||
link.download = "extraordinary12.mp3";
|
||||
link.href = url;
|
||||
link.click();
|
||||
})
|
||||
.catch(console.log)
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
creating a text blob
|
||||
```js
|
||||
const textData = "Hello, this is my text content!";
|
||||
const textBlob = new Blob([textData], { type: 'text/plain' });
|
||||
```
|
||||
Loading…
Reference in a new issue