Click here to Skip to main content
15,885,757 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
C#
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);
});
Posted
Updated 4-Aug-16 0:37am

1 solution

Quote:
How to extract the compressed file into defined location using angularjs or any javascript library
I think you can't. it is a security feature.
If it was possible, any web page would be able to install things on your PC.
It is the user task to choose directory and to unzip files.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900