import { Injectable } from '@angular/core';
import { HttpHeaderOptions } from 'src/app/dtos/http-header-option';
import { HttpHeaders } from '@angular/common/http';

@Injectable({
  providedIn: 'root'
})
export class BlobService {
  httpHeaderOptions : HttpHeaderOptions = new HttpHeaderOptions();
  public insertFile(fileToUpload: any) {
    this.httpHeaderOptions.headers = new HttpHeaders({
      'Content-Type': 'multipart/form-data'
    });
    //this.httpHeaderOptions.headers.append();
    //return this.saveItems('/Storage/Upload', fileToUpload, this.httpHeaderOptions, true);
  }

  public downloadFile(fileName: any) {
    this.httpHeaderOptions.responseType = 'blob';
    //return this.loadItems('/Storage/DownloadFile/' + fileName, this.httpHeaderOptions);
  }

  public deleteFile(fileName: any) {
    // return this.loadItems('/Storage/DeleteFile/' + fileName);
  }

}
