# Create File

The Create File Data Operation generates a file from the content that is passed in. The generated file can be accessed through a URL which can then be passed throughout a journey.&#x20;

## Use Cases

* [Generate an .ics file](../../building-apps/calendars/integrating-to-external-calendars) to add an event to a user's calendar
* Generate .CSV files that can be uploaded/downloaded from a user or a data store

## Data Operation Properties

### Filename

Expects type `text`.

The filename of the generated file. This field is required.&#x20;

### MIME Type

Expects type `text`.

The media type that indicates the nature of the content passed in. This field is required in order to create a file. For more information, see [MIME Types](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types).&#x20;

Supported MIME Types include:

* application/pgp-encrypted
* application/pdf
* application/pgp-encrypted
* application/vnd.ms-excel
* application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
* application/zip
* audio/mpeg
* audio/mp3
* audio/wav
* font/otf
* font/ttf
* font/woff
* font/woff2
* image/gif
* image/jpeg
* image/jpg
* image/png
* image/svg
* image/svg+xml
* text/html
* text/plain
* video/mp4

### Content Encoding

Expects type `text`.

Files can be passed as base64 encoded. Use the following value to indicate to the system the content encoding type:

```
base64
```

### Content

Expects type `text`.

The file string that contains the content of the file that will be generated.&#x20;

### Asset Setting

\###Scope

Determines the scope of the download link. This can either be **APP** or **SESSION**. If the created file should be accessible from other user sessions, choose **APP**. Otherwise, if the created file is unique per customer, choose **SESSION**.

\###Visibility

Determines the visibility of the download link. This can either be **GLOBAL**or **PRIVATE**. If the generated file has sensitive customer information, it should be marked as **PRIVATE**. With **PRIVATE**, the file will have an extra layer of access protection. The generated URL will have the necessary credentials to access the file.

**NOTE:** The generated URL for the file allows anyone to access the file. The URL should only be shown to the customer that the PDF belongs to.

\###Download Url Expiration

Expects type `number`.

Only appears when **Visibility** is marked **PRIVATE**, as **Global** Assets do not expire.

Determines how long the download link to the file is available. For instance, if **30 Minutes** is given, the download link will no longer work after thirty minutes. **Private** Assets must expire after a maximum of 7 days.

\###Hash Type

The hash type selected from the dropdown will automatically generate a hash when files are uploaded to the Asset store.

## Run Results

A Variable is automatically created to hold the results of this Operation. This result will be an object with several keys that describe the generated file.

The most important of these keys is `downloadUrl`, which is a URL that downloads the generated file when accessed.
