axios download excel \ file
JavaScript
export function someFunction(values) {
return (dispatch) => {
...
const method = 'GET';
const url = 'http://go.api/download_file';
...
axios
.request({
url,
method,
responseType: 'blob', //important
})
.then(({ data }) => {
const downloadUrl = window.URL.createObjectURL(new Blob([data]));
const link = document.createElement('a');
link.href = downloadUrl;
link.setAttribute('download', 'file.zip'); //any other extension
document.body.appendChild(link);
link.click();
link.remove();
});
};
}
axios({
url: 'http://api.dev/file-download',
method: 'GET',
responseType: 'blob', // important
}).then((response) => {
const url = window.URL.createObjectURL(new Blob([response.data]));
const link = document.createElement('a');
link.href = url;
link.setAttribute('download', 'file.pdf'); //or any other extension
document.body.appendChild(link);
link.click();
});
Also in JavaScript:
- Title
- express() vs express.router()
- Category
- JavaScript
- Title
- how to deploy react app in tomcat server
- Category
- JavaScript
- Title
- compare two arrays javascript
- Category
- JavaScript
- Title
- how to get variable in local storage in javascript
- Category
- JavaScript
- Title
- how to Fetch the index of table row using jquery
- Category
- JavaScript
- Title
- get the size of the browser jquery
- Category
- JavaScript
- Title
- clear scene\
- Category
- JavaScript
- Title
- curl post json object command
- Category
- JavaScript
- Title
- how to add two number using jqueryu
- Category
- JavaScript
- Title
- convert array object to string javascript
- Category
- JavaScript
- Title
- disable right click javascript
- Category
- JavaScript
- Title
- how to check chrome version in js
- Category
- JavaScript
- Title
- import dropdown react
- Category
- JavaScript
- Title
- how to find remainder in javascript
- Category
- JavaScript
- Title
- javascript closure stack overflow
- Category
- JavaScript
- Title
- how to set height of material ui dialog react
- Category
- JavaScript
- Title
- How to check whether a string contains a substring in JavaScript?
- Category
- JavaScript
- Title
- find least common multiple javascript
- Category
- JavaScript
- Title
- example of validating fields on your own in express
- Category
- JavaScript
- Title
- hover jquery
- Category
- JavaScript
- Title
- bootstrap modal remove gray background
- Category
- JavaScript
- Title
- filter out arrays js
- Category
- JavaScript
- Title
- how to see if a web site is useing react
- Category
- JavaScript
- Title
- disable javascript chrome
- Category
- JavaScript
- Title
- how to set diferent images in html through js
- Category
- JavaScript
- Title
- input output ionic
- Category
- JavaScript
- Title
- how to make @click in router-link vuejs
- Category
- JavaScript
- Title
- if clicked outside of div jquery
- Category
- JavaScript
- Title
- for loop javascript
- Category
- JavaScript
- Title
- fill array with values javascript
- Category
- JavaScript
- Title
- .change() in pure js
- Category
- JavaScript
- Title
- how to convert string to int js
- Category
- JavaScript
- Title
- disable input angular
- Category
- JavaScript
- Title
- import vue js
- Category
- JavaScript
- Title
- convert string with dot or comma as decimal separator to number in javascript
- Category
- JavaScript
- Title
- at leastone checkbox required jquery
- Category
- JavaScript
- Title
- express how to access ajax post data
- Category
- JavaScript
- Title
- javascript change attribute
- Category
- JavaScript
- Title
- javascript after split then trim whitespace
- Category
- JavaScript
- Title
- how to get last item in array javascript
- Category
- JavaScript
- Title
- how to add two attay into object in javascript
- Category
- JavaScript
- Title
- explode in jquery
- Category
- JavaScript
- Title
- how to update jquery datatable row cell value
- Category
- JavaScript
- Title
- convert json to 2d array
- Category
- JavaScript
- Title
- get unique id angular
- Category
- JavaScript
- Title
- append to array js
- Category
- JavaScript
- Title
- install php7 runtime brackets
- Category
- JavaScript
- Title
- box shadow javascript style change
- Category
- JavaScript
- Title
- how to know if a number has a decimal number js
- Category
- JavaScript
- Title
- can we import jquery library from developer tools
- Category
- JavaScript
- Title
- javascript ajax post send an object
- Category
- JavaScript
- Title
- hamster js
- Category
- JavaScript
- Title
- ad data to js object
- Category
- JavaScript
- Title
- for function js
- Category
- JavaScript
- Title
- how to access child img src in jquery
- Category
- JavaScript
- Title
- if else practice javascript
- Category
- JavaScript
- Title
- Adding and Deleting html Elements
- Category
- JavaScript
- Title
- check for string in string javascript
- Category
- JavaScript
- Title
- javascript change web page title
- Category
- JavaScript
- Title
- getcollectionnames
- Category
- JavaScript
- Title
- area of a circle
- Category
- JavaScript
- Title
- cordova capacitor document viewer fail
- Category
- JavaScript
- Title
- icon shwoing a box react native vector icons
- Category
- JavaScript
- Title
- how to remove first character from string in javascript
- Category
- JavaScript
- Title
- how to english paragraph matching in javascript
- Category
- JavaScript
- Title
- How can I upload files asynchronously
- Category
- JavaScript
- Title
- how to use custom stylesheets express node
- Category
- JavaScript
- Title
- empty array js
- Category
- JavaScript
- Title
- append img to svg d3 js
- Category
- JavaScript
- Title
- iso to date javascript
- Category
- JavaScript
- Title
- express render
- Category
- JavaScript
- Title
- get current url js
- Category
- JavaScript
- Title
- get value of hidden field jquery
- Category
- JavaScript
- Title
- Cannot set property 'innerHTML' of null
- Category
- JavaScript
- Title
- get attribute value jquery
- Category
- JavaScript
- Title
- how to push values in array
- Category
- JavaScript
- Title
- Javascript check for hash in URL
- Category
- JavaScript
- Title
- how to get textedit on mac without download
- Category
- JavaScript
- Title
- how to remove attrivusre with jquery
- Category
- JavaScript
- Title
- angularjs iframe src binding
- Category
- JavaScript
- Title
- how to detect a keypress in javascript
- Category
- JavaScript
- Title
- get the index of object in array
- Category
- JavaScript
- Title
- componentwillreceiveprops hooks
- Category
- JavaScript
- Title
- how the map function works javascript
- Category
- JavaScript
- Title
- angular onchange event
- Category
- JavaScript
- Title
- Javascript clear canvas
- Category
- JavaScript
- Title
- create react native app npx
- Category
- JavaScript
- Title
- how to add element in json object
- Category
- JavaScript
- Title
- grayscale image in canvas
- Category
- JavaScript
- Title
- create a json object in javascript
- Category
- JavaScript
- Title
- firestore batch add array
- Category
- JavaScript
- Title
- ckeditor change value
- Category
- JavaScript
- Title
- hot to start cypress
- Category
- JavaScript
- Title
- fibonacci best performance javascript
- Category
- JavaScript
- Title
- how to verify timestamp format in javascript
- Category
- JavaScript
- Title
- add multiple images inside the DOM js
- Category
- JavaScript
- Title
- javascript change meta tag
- Category
- JavaScript
- Title
- angular npx
- Category
- JavaScript
- Title
- array of images javascript
- Category
- JavaScript
- Title
- document load javascript
- Category
- JavaScript