angularfire icon indicating copy to clipboard operation
angularfire copied to clipboard

Problem downloading documents containing utf-8 specific chars via afStorage

Open lamarqued opened this issue 2 years ago • 0 comments

Hello,

First of all, thank you very much for your work, your lib has helped me so much in my project.

I think I spotted a bug within the AngularFireStorage part.

It seems like I cannot upload files containing utf-8 specific characters (é, è, ô).

To give you a little bit of context, I have a component with a pdfName as @Input and in the template of this component, a button calling the following function :

downloadPdf(): void {
    const filePath = `pdfs/${this.pdfName}.pdf`;
    const storageRef = this.afStorage.ref(filePath);
    
    ...
}

When calling that function with a pdfName containing accents, I receive the following error :

ERROR FirebaseError: Firebase Storage: Object 'pdfs/Les deux portées.pdf' does not exist. (storage/object-not-found)
{
  "error": {
    "code": 404,
    "message": "Not Found."
  }
}

, while the pdfs not containing accents download without trouble.

Version info

Angular: 12.2.0

Firebase: 9.4.0

AngularFire: 7.2.0

How to reproduce these conditions

Steps to set up and reproduce

  1. Upload in Firebase storage a document containing an accent (here is one : é) or I imagine any utf-8 specific character
  2. Try to download it via AngularFireStorage

Debug output

ERROR FirebaseError: Firebase Storage: Object 'pdfs/Les deux portées.pdf' does not exist. (storage/object-not-found)
{
  "error": {
    "code": 404,
    "message": "Not Found."
  }
}

lamarqued avatar May 27 '23 11:05 lamarqued