added download only mode that simply downloads files to the client when the server finishes the download

added dependency on savefile library for download-only mode
This commit is contained in:
Isaac Grynsztein
2020-02-11 13:10:02 -05:00
parent 10c90a01f2
commit ba5592015d
5 changed files with 69 additions and 37 deletions

View File

@@ -1,5 +1,5 @@
import {Injectable, isDevMode} from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { HttpClient, HttpHeaders, HttpRequest, HttpResponseBase } from '@angular/common/http';
import config from '../assets/default.json';
import 'rxjs/add/operator/map';
import { Observable } from 'rxjs/Observable';
@@ -75,6 +75,10 @@ export class PostsService {
getMp4s() {
return this.http.post(this.path + 'getMp4s', {});
}
downloadFileFromServer(fileName, type) {
return this.http.post(this.path + 'downloadFile', {fileName: fileName, type: type}, {responseType: 'blob'});
}
}