Adding binary files to a Fiori app

Published by Tobias Hofmann on

5 min read

Deploying a Fiori app to an ABAP system like S/4HANA is simple. Once the deployment configuration for the backend is added, it is just running the deploy command: fiori deploy. For the usual Fiori app this works just fine.

In case you have added a binary file like a font or a plain text file without any suffix to your Fiori app, the deploy will fail. This is intentional. For a file that is using an unknown suffix like .xyz, the upload is blocked. The repository where the Fiori (UI5) files are stored supports a given list of files. Uploading any file to it might not be what you want. This mechanism is preventing you to upload any file to the UI5 repository.

Sometimes you need to upload a custom Fiori app to your ABAP server that includes files that are not supported. Running fiori deploy fails with an error. As an example, let’s add some woff/tff font files or just a simple text file without any suffix like description.

The app runs locally without any problems and can be build. Trying to deploy it via fiori deploy fails. Sample log output:

The deploy fails with status code 400.

Going through the output, the reason why the deploy failed is given.

For sample description file:

Error message:

*** IGNORE *** : <file> (Not uploaded as binary/text type is unknown: Adjust content of files .UI5RepositoryTextFiles and .Ui5RepositoryBinaryFiles)

The reason why the deploy failed is given: file type is not known. The font files are without suffix (.woff, .ttf, just a hash as file name), the first file in the list is with an unknown suffix and the last file is just a text file without a suffix too. Therefore, all these files are unknown to the deploy tool and are rejected.

The error message also contains not only the hint why the deploy failed, but also how to fix it. The hint allows to find a solution on the internet: the UI5 SDK documentation: Using an OData Service to Load Data to the SAPUI5 ABAP Repository (formatting could be better, e.g. provide a header to highlight the section)

The files ‘Ui5RepositoryIgnore’, ‘.Ui5RepositoryTextFiles’ and ‘.Ui5RepositoryBinaryFiles’ can be used to indicate patterns to ignore or add files. To add a file pattern, use .Ui5RepositoryTextFiles for text files and .Ui5RepositoryBinaryFiles for binary files.

Note: The file name is .Ui5RepositoryTextFiles which is different from the file name given in the error log .UI5RepositoryTextFiles: Ui5 vs UI5. The correct one is Ui5RepositoryTextFiles! Ignore what the error output shows you. The file names must be as given in the UI5 SDK documentation: .Ui5Repository…

The .Ui5Repository… files need to be added to the webapp directory, as they must be part of the build app and archive.zip file sent to the SAP system.

Example: Adding an unknown text file to the deploy

File description is a plain text file (here: empty).

Ein Bild, das Text, Schrift, Screenshot enthält.

KI-generierte Inhalte können fehlerhaft sein.

Location of .Ui5RepositoryTextFiles in webapp.

Ein Bild, das Text, Screenshot, Schrift enthält.

KI-generierte Inhalte können fehlerhaft sein.

Content of file .Ui5RepositoryTextFiles.

Ein Bild, das Text, Schrift, Screenshot, Zahl enthält.

KI-generierte Inhalte können fehlerhaft sein.

Deploy output

The file description is now uploaded and the deploy works.

Example using .UI5RepositoryTextFiles

Ein Bild, das Text, Schrift, Screenshot enthält.

KI-generierte Inhalte können fehlerhaft sein.

Running deploy the file description gets deleted as invalid.

The text file description is not uploaded. The content of the file .UI5RepositoryTextFiles is ignored.

Issue was created.

Let the world know
Categories: FioriSAP

Tobias Hofmann

Doing stuff with SAP since 1998. Open, web, UX, cloud. I am not a Basis guy, but very knowledgeable about Basis stuff, as it's the foundation of everything I do (DevOps). Performance is king, and unit tests is something I actually do. Developing HTML5 apps when HTML5 wasn't around. HCP/SCP user since 2012, NetWeaver since 2002, ABAP since 1998.

0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.