# Using files in your builds

There are multiple ways to use files in your Bitrise builds.

• Most Steps that generate files store the filepath in an output Environment Variable (Env Var). Subsequent Steps in the same Workflow can re-use that Env Var to access the file.

• You can upload a file to the Generic File Storage and use the automatically generated Env Var as a Step input value in Steps that accept URLs as an input.

• You can upload a file to the Generic File Storage and use one of our Steps (for example, the File Downloader Step) to download the file for the build. This works with Steps that require local file paths and as such do not support URLs directly as the input value.

Once you uploaded a file to the Generic File storage, one of the ways to access it is by using the File Downloader Step. This Step is useful when you need to use a file in a Step input that only accepts local paths as a value.

The Step downloads the file in a location you specify, and then every subsequent Step can access the file in that location.

1. Open your app on Bitrise.

2. Go to the Workflow tab.

3. Go to the Code signing tab and then the Generic File Storage tab.

4. Find your file and copy the Environment Variable (Env Var) under its filename.

5. Go to the Workflows tab.

6. Select a Workflow from the WORKFLOW dropdown menu.

8. In the Download source url input, paste the Env Var you copied earlier.

9. In the Download destination path input, specify the path where you want to download the file. It should be a path relative to the root of the repository.

### Using an Env Var as the input value

You can store the filepath in an App Env Var instead of specifying it directly for the input. That way you can refer to the file through the Env Var in other Steps, you won’t have to specify the path every time.

For example, if you store the path in the BITRISEIO_MY_FILE_LOCAL_PATH Env Var, you can use it as the path for the input, and also use it to access the file in every subsequent Step.

10. Click in the top right corner.

1. Open your app on Bitrise.

2. Go to the Workflow tab.

3. Go to the Code signing tab and then the Generic File Storage tab.

4. Find your file and copy the Environment Variable (Env Var) under its filename.

5. Go to the Workflows tab.

6. Select a Workflow from the WORKFLOW dropdown menu.

8. Find the Script content input of the Step.

In the example below, the download URL is stored in the BITRISE_IO_MY_FILE_ID_URL Env Var. We're using envman to store the local path in the BITRISEIO_MY_FILE_LOCAL_PATH Env Var. Subsequent Steps can use this Env Var to access the file.

#!/bin/bash
set -ex

wget -O "$file_local_path" "$BITRISEIO_MY_FILE_ID_URL"
echo "file downloaded to: $file_local_path" # OPTIONALLY: export the file's local path, to be able to use it in subsequent steps as an input value envman add --key BITRISEIO_MY_FILE_LOCAL_PATH --value "$file_local_path"