Assets

Explanation on assets.

Assets allow users to view files (e.g. images), upload and download files (e.g. CSV) in a web-app.

  • An asset is unstructured data stored on the Packhunt platform (e.g. an image file).
  • Assets can be public or private:
    • Public assets are files which are readable by anyone, including non-logged-in users.
    • Private assets are files which are accessible only by users who have at least “can use” access to the project.

There are two ways of creating an asset on Packhunt:

In the Grasshopper definition
You can create an asset by using the Packhunt Create Asset component in Grasshopper. This allows you to download files (e.g. CSV) with parametric content in the web-app user interface. For instructions, see the download files guide guide.

In the solution
You can save the file(s) in an “assets” folder and define your assetPath in the solution.yaml file. Once your solution is deployed, public assets are created for your file(s).

❗ To save a new version of the asset with updated file content, you need to rename your file (e.g. “my-file-name-2.png”) and deploy your solution.

By creating assets in the solution, you can:

  • Display images in the solution as a block, login logo and background, navigation image and select image control.
  • Display static geometry in the viewer. For instructions, see the show static geometries guide.

The configuration should look similar to the example below:

kind: Solution
version: v0
assetsPath: my-assets

The solution structure looks like the image below.