---
title: "File"
slug: "file"
abstract: "Overview, parameters, and example for the File Object."
---
# File

You can fetch files from an HTTP resource, based on specific parameters, and define its name according to the file URL.

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| `type` | String | The type of source to retrieve the file from (**Web** for an HTTP resource). |
| `href`* | String | In case of a **Web** type, the URL of the resource. |

## Web fetch

You can use the **Web** fetch source to retrieve resources that are accessible from an (optionally pre-signed) URL.

```csharp
{
  "type" : "Web",
  "href" : "http://www.url.to/file/online.jpg"
}

```

To determine the filename, a web fetch evaluates the following in order:

1. If the **Content-Disposition header** includes a filename, it uses that filename (for example, `Content-Disposition: attachment; filename="report.pdf"`).
2. If the URL refers to a filename, it uses that filename (for example, `http://www.gstatic.com/webp/gallery/5.jpg` results in `5.jpg` as the filename).
3. If there is a **filename** parameter in the URL, it uses the value for the file name (for example, `http://picsum.photos/400/300/?image=1&filename=test.jpeg` results in **test.jpeg**).
4. If none of the above are available, the web fetch reverts to the hostname, top level domain, and a GUID (Globally Unique IDentifier). These concatenate automatically using **_** (underscore) (for example, `http://picsum.photos/400/300/?image=1` results in `picsum_photos_814be`). There are no file extensions.