Click here to Skip to main content
14,383,961 members
Rate this:
Please Sign up or sign in to vote.
See more: , +
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 1:37am

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

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.
   

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




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100