Class: QgsFileDownloader

class qgis.core.QgsFileDownloader

Bases: PyQt5.QtCore.QObject

QgsFileDownloader is a utility class for downloading files.

To use this class, it is necessary to pass the URL and an output file name as arguments to the constructor, the download will start immediately.

The download is asynchronous.

The object will destroy itself when the request completes, errors or is canceled. An optional authentication configuration can be specified.

Note

This class was part of the GUI library from QGIS 2.18.1 until QGIS 3.0

New in version 3.0.

QgsFileDownloader(url: QUrl, outputFileName: str, authcfg: str = ‘’, delayStart: bool = False) QgsFileDownloader

Parameters
cancelDownload(self)

Call to abort the download and delete this object after the cancellation has been processed.

childEvent(self, QChildEvent)
connectNotify(self, QMetaMethod)
customEvent(self, QEvent)
disconnectNotify(self, QMetaMethod)
downloadCanceled

Emitted when the download was canceled by the user.

See also

cancelDownload() [signal]

downloadCompleted

Emitted when the download has completed successfully [signal]

Parameters

url (QUrl) –

downloadError

Emitted when an error makes the download fail [signal]

Parameters

errorMessages (Iterable[str]) –

downloadExited

Emitted always when the downloader exits [signal]

downloadProgress

Emitted when data are ready to be processed [signal]

Parameters
  • bytesReceived (int) –

  • bytesTotal (int) –

isSignalConnected(self, QMetaMethod) bool
receivers(self, PYQT_SIGNAL) int
sender(self) QObject
senderSignalIndex(self) int
startDownload(self)

Called to start the download

timerEvent(self, QTimerEvent)