Starts in:
1 DAY
19 HRS
37 MIN
23 SEC
Starts in:
1 D
19 H
37 M
23 S

Activities of "creosource"

  • ABP Framework version: v4.4.0
  • UI type: Angular
  • DB provider: EF Core /
  • Tiered (MVC) or Identity Server Separated (Angular): no
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

I am trying to download a PDF file in Angular from a call to the backend, I have tried a bunch of different methods but get the same results: "Http failure during parsing for https://localhost:44367/downloadreport/f6f8401a-26d6-0ed6-30f8-39fef69a5343" Unexpected token % in JSON at position 0 text: 772 kb

On my backend I have tried creating a controller that return RemoteStreamContent like this:

      [HttpGet]
      [Route("downloadreport/{userTestId}")]
      public async Task<RemoteStreamContent> DownloadReportAsync(Guid userTestId)
      {
         var fileDto = await _reportService.GetPDFReport(userTestId);

         MemoryStream stream = new MemoryStream(fileDto.Content);

         return new RemoteStreamContent(stream, fileDto.Name);
      }
      
I have also tried returning a File() like this:
  [HttpGet]
  [Route("downloadreport/{userTestId}")]
  public async Task<IActionResult> DownloadReportAsync(Guid userTestId)
  {
     var fileDto = await _reportService.GetPDFReport(userTestId);

     return File(fileDto.Content, "application/octet-stream", fileDto.Name);
  }

In Angular I have the following code: downloadUserTest(id: string) { this.reportService.downloadReport(id).subscribe(x => { console.log(x); }); }

Am trying to figure out what I am doing wrong, can someone help please ?

Thanks!

Hi,

I was wondering if there is a way to add additional settings to Administration/Settings pages in Angular ? Currently there are four tabs: Emailing Identity Management Lepton Theme Account

Can we add a fourth tab ?

Showing 1 to 2 of 2 entries
Made with ❤️ on ABP v9.1.0-preview. Updated on November 20, 2024, 13:06