'"Failed - Blocked" messaged popped up when downloading .eml file from servers but it is working locally in localhost:4200

Failed blocked message:

It's an Angular application. when I click the "download" link locally in 4200, the file can download without error. But when downloaded from a rnd server, it pops the "Failed - blocked" error. It is the same Chrome browser I am using in both situations. I see solution of setting "Launching applications and unsafe files." to "Prompted". I checked. The setting was already such. Apparently it is not fixing the "Failed - blocked" error.

Here is the angular code

    this.http.post(this.END_POINT+"/download/" + emailMessageId, Blob).subscribe((res) => {
     
      const byteCharacters = atob(res['something']);
      const byteNumbers = new Array(byteCharacters.length);
      for (let i = 0; i < byteCharacters.length; i++) {
        byteNumbers[i] = byteCharacters.charCodeAt(i);
      }
      const byteArray = new Uint8Array(byteNumbers);
     

      let blob = new Blob([byteArray], { type: "application/eml" });
      var link = document.createElement('a');
      link.href = window.URL.createObjectURL(blob);
      link.download = "email.eml";
      link.click();
      document.body.appendChild(link);         
    })    

  }```


Solution 1:[1]

As far as I know the UID matching the credentials is not exposed in this error message, so you will have to look it up another way. The best I can think of is using the Admin SDK to find the user by their email address.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Frank van Puffelen