---
schema_version: "1"
id: e118b79ddf024eabd5bf56c172f58cfda017fed2e129ba384033b548b643d36b
title: File Download
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/lightning-base-components/lightning-design-system/guides/lwc/components/lightning/fileDownload/lightning-file-download.md
canonical_url: https://developer.salesforce.com/docs/platform/lightning-component-reference/guide/lightning-file-download.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 1200e62295335d89c916936629fc69c9ef4b5272308b78719861a8d925733513
products:
  - Lightning Component Reference
---
# File Download

**`lightning/fileDownload`**

Download a file in an LWR site in Experience Cloud.

**For Use In**

Experience Builder Sites

::::::tabset{tabs='["Develop", "Specifications"]'}

:::::tab

Add file downloads to Experience Cloud sites that use the Build Your Own (LWR) template.

To create a component that downloads a file, import `generateUrl` from `lightning/fileDownload`. Use the `generateUrl` function and pass in the record ID number of the files that you want to download. This function supports Content Document, Content Version, Attachment, or Document record IDs.

```javascript
import { generateUrl } from "lightning/fileDownload";
```

For this module's documentation, see the [Lightning Web Components Developer Guide](https://developer.salesforce.com/docs/platform/lwc/guide/reference-lightning-file-download-api.html).


:::::

:::::tab

::component-specification{component="fileDownload" model="lwc" namespace="lightning"}


:::::

::::::
