Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

jQuery download video from URL

fetch('http://127.0.0.1:8000/watch/2DPdo74U-zs')
  .then(resp => resp.blob())
  .then(blob => {
    const url = window.URL.createObjectURL(blob);
    const a = document.createElement('a');
    a.style.display = 'none';
    a.href = url;
    // the filename you want
    a.download = 'todo-1.json';
    document.body.appendChild(a);
    a.click();
    window.URL.revokeObjectURL(url);
    alert('your file has downloaded!'); // or you know, something with better UX...
  })
  .catch(() => alert('oh no!'));
 Run code snippetHide results
Comment

PREVIOUS NEXT
Code Example
Javascript :: remove an item from the end of an array 
Javascript :: can we use setstate inside build 
Javascript :: javascript Use clearTimeout() Method 
Javascript :: passport google authentication node js 
Javascript :: adding all elements in an array javascript 
Javascript :: what is the use of useparams in react 
Javascript :: react-native-dropdown-picker for form react native 
Javascript :: Define Number Prop Vue 
Javascript :: change dictionary value in React js 
Javascript :: regex for fullstop 
Javascript :: got bearer auth 
Javascript :: this keyword in javascript 
Javascript :: js !! 
Javascript :: hide console log level in js 
Javascript :: node js create or check directory 
Javascript :: react node-sass 
Javascript :: vue js data property in component must be a function 
Javascript :: async arrow function javascript 
Javascript :: get ip address with js 
Javascript :: jquery creating several items 
Javascript :: ApolloClient 
Javascript :: createElement calls with JSX 
Javascript :: create own rules jquery 
Javascript :: react fun tion 
Javascript :: componentdidmount react hooks 
Javascript :: google drive show size folder 
Javascript :: how to put submit type of input element in a queryselector in javascript 
Javascript :: add update react pwa feature 
Javascript :: recursive function javascript 
Javascript :: what is on and once in node 
ADD CONTENT
Topic
Content
Source link
Name
9+1 =