1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

Incorrect file format error while importing spreadjs

Discussão em 'Angular' iniciado por Ramesh Rajendran, Maio 23, 2025.

  1. I am getting invalid file format error while importing spreadjs

    loadSpreadSheet(assetFile: any) {
    let fileContent = assetFile.fileContent;
    const uint8Array = Uint8Array.from(atob(fileContent), c => c.charCodeAt(0));
    const blb = new Blob([uint8Array])
    const file = new File([blb], 'abc.xlsx', { type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" });

    if (!file) {
    return;
    }
    var options: any = this.getOptions('open');
    this.changedetector.detectChanges();
    this.spread.import(file, function () { console.log("succ") }, function (error) { console.log(error) }, { fileType: GC.Spread.Sheets.FileType.excel });
    this.changedetector.detectChanges();
    }


    The same above code is working fine in my POC. But when I am integrating the same code in my Realtime application I am getting this below error [​IMG]

    Only different is, This code is available inside library which is binding in iFrame.

    Continue reading...

Compartilhe esta Página