down vote
favorite
I have hosted one Folder in local IIS,the folder which includes compressed files.
When i'm making http request to that hosted url, it is automatically downloaded into default location i.e. Downloads.
I want to select the destination path for that file saving path and before saving into that destination path it should extracted.
Tell me any approach which should be client side like javascript, angularjs, etc,.
Can any one tell me how to do this Thanks in advance.
Please follow below which i have wrote in my application. Any one can update the below code or propose new approach.
What I have tried:
$http({
method: 'GET',
url: 'http://localhost:1234/' + filename+'.zip',
responseType: 'arraybuffer'
}).success(function (data, status, headers) {
headers = headers();
var contentType = headers['content-type'];
var linkElement = document.createElement('a');
try {
var blob = new Blob([data], { type: contentType});
var url = window.URL.createObjectURL(blob);
linkElement.setAttribute('href', url);
linkElement.setAttribute("download", filename);
linkElement.setAttribute('target', '_blank');
linkElement.click();
} catch (ex) {
console.log(ex);
}
}).error(function (data) {
console.log(data);
});