# Luakit Documentation / Classes / download

# Class `download`

Luakit download interface

This class provides an interface to managing ongoing downloads.

## Properties

### download.allow_overwrite

Type: boolean
Default: `false`
Read-write
Whether this download should be permitted to overwrite any file already existing at the destination.

### download.destination

Type: string
Default: `nil`
Read-write
The path at which the downloaded file should be saved.

### download.progress

Type: number
Read-only
The download progress, ranging from 0.0 (no data yet received) to 1.0 (all data received). This is only an estimate; see the `current_size` property for a more exact value.

### download.status

Type: string
Read-only
The download status. Will be one of `"created"`, `"started"`, `"cancelled"`, `"finished"`, or `"failed"`.

### download.error

Type: string or nil
Read-only
The error message for the download, or `nil`.

### download.total_size

Type: number
Read-only
The total size of the file to be downloaded, including all data not yet downloaded.

### download.current_size

Type: number
Read-only
The current size of all data that has been downloaded and written to the destination.

### download.elapsed_time

Type: number
Read-only
The length of time that the download has been running, in seconds. This includes any fractional part.

### download.mime_type

Type: string or nil
Read-only
The MIME type of the download, if known.

### download.suggested_filename

Type: string
Read-only
The suggested filename to use, for use in dialog boxes.

## Signals

### "property::allow-overwrite"

Emitted when the `allow_overwrite` property has changed.

### "property::destination"

Emitted when the `destination` property has changed.

### "decide-destination"

Emitted when a destination for the download must be decided. Handlers should set the download's `destination` property.

#### Parameters

- suggested_filename
  Type: string
  The suggested filename for the download.

#### Return Values

- boolean
  `true` if the destination was decided.

### "created-destination"

Emitted when the destination has been created.

#### Parameters

- destination
  Type: string
  The final destination for the download.

### "error"

Emitted when the download fails.

#### Parameters

- message
  Type: string
  The error message.

### "finished"

Emitted when the download has finished.

## Attribution

#### Copyright

- 2011 Fabian Streitel
- 2011 Mason Larobina