Check if download is finished in angular 5
up vote
1
down vote
favorite
I am using Angular 5 and Angular5csv for exporting csv, I want to detect if the downloaded file is finish downloading so that I can add success message, how can I achieve that?
Here is my code in generating csv file:
downloadReport(reportName){
this.reports = ;
this.loadReport = true;
this.data.getReports(rosterId,reportName)
.subscribe((data:any)=>{
var report = data.value.toString().replace(/['"]+/g, '').split('n');
for (let index = 0; index < report.length; index++) {
this.reports[index] = report[index].split(',');
}
this.loadReport = false;
new Angular5Csv(this.reports,reportName.replace("_",' '));
this.logger.success("Success","Downloaded report successfully."); // Add success message here after download
},()=>{
this.logger.error("Error","An error occured while processing your request.");
this.loadReport = false;
});
}
angular
add a comment |
up vote
1
down vote
favorite
I am using Angular 5 and Angular5csv for exporting csv, I want to detect if the downloaded file is finish downloading so that I can add success message, how can I achieve that?
Here is my code in generating csv file:
downloadReport(reportName){
this.reports = ;
this.loadReport = true;
this.data.getReports(rosterId,reportName)
.subscribe((data:any)=>{
var report = data.value.toString().replace(/['"]+/g, '').split('n');
for (let index = 0; index < report.length; index++) {
this.reports[index] = report[index].split(',');
}
this.loadReport = false;
new Angular5Csv(this.reports,reportName.replace("_",' '));
this.logger.success("Success","Downloaded report successfully."); // Add success message here after download
},()=>{
this.logger.error("Error","An error occured while processing your request.");
this.loadReport = false;
});
}
angular
angular.io/guide/http#listening-to-progress-events
– Faisal
Nov 8 at 7:26
No use. I want to check if it is finish downloading in my computer
– asdfghmak
Nov 8 at 10:50
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I am using Angular 5 and Angular5csv for exporting csv, I want to detect if the downloaded file is finish downloading so that I can add success message, how can I achieve that?
Here is my code in generating csv file:
downloadReport(reportName){
this.reports = ;
this.loadReport = true;
this.data.getReports(rosterId,reportName)
.subscribe((data:any)=>{
var report = data.value.toString().replace(/['"]+/g, '').split('n');
for (let index = 0; index < report.length; index++) {
this.reports[index] = report[index].split(',');
}
this.loadReport = false;
new Angular5Csv(this.reports,reportName.replace("_",' '));
this.logger.success("Success","Downloaded report successfully."); // Add success message here after download
},()=>{
this.logger.error("Error","An error occured while processing your request.");
this.loadReport = false;
});
}
angular
I am using Angular 5 and Angular5csv for exporting csv, I want to detect if the downloaded file is finish downloading so that I can add success message, how can I achieve that?
Here is my code in generating csv file:
downloadReport(reportName){
this.reports = ;
this.loadReport = true;
this.data.getReports(rosterId,reportName)
.subscribe((data:any)=>{
var report = data.value.toString().replace(/['"]+/g, '').split('n');
for (let index = 0; index < report.length; index++) {
this.reports[index] = report[index].split(',');
}
this.loadReport = false;
new Angular5Csv(this.reports,reportName.replace("_",' '));
this.logger.success("Success","Downloaded report successfully."); // Add success message here after download
},()=>{
this.logger.error("Error","An error occured while processing your request.");
this.loadReport = false;
});
}
angular
angular
asked Nov 8 at 6:38
asdfghmak
237
237
angular.io/guide/http#listening-to-progress-events
– Faisal
Nov 8 at 7:26
No use. I want to check if it is finish downloading in my computer
– asdfghmak
Nov 8 at 10:50
add a comment |
angular.io/guide/http#listening-to-progress-events
– Faisal
Nov 8 at 7:26
No use. I want to check if it is finish downloading in my computer
– asdfghmak
Nov 8 at 10:50
angular.io/guide/http#listening-to-progress-events
– Faisal
Nov 8 at 7:26
angular.io/guide/http#listening-to-progress-events
– Faisal
Nov 8 at 7:26
No use. I want to check if it is finish downloading in my computer
– asdfghmak
Nov 8 at 10:50
No use. I want to check if it is finish downloading in my computer
– asdfghmak
Nov 8 at 10:50
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53202596%2fcheck-if-download-is-finished-in-angular-5%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
angular.io/guide/http#listening-to-progress-events
– Faisal
Nov 8 at 7:26
No use. I want to check if it is finish downloading in my computer
– asdfghmak
Nov 8 at 10:50