QGIS API Documentation 4.1.0-Master (3b8ef1f72a3)
Loading...
Searching...
No Matches
QgsFileUploader Class Reference

A utility class for uploading files. More...

#include <qgsfileuploader.h>

Inheritance diagram for QgsFileUploader:

Public Slots

void cancelUpload ()
 Call to abort the upload and delete this object after the cancellation has been processed.
void startUpload ()
 Called to start the upload.

Signals

void uploadCanceled ()
 Emitted when the upload was canceled by the user.
void uploadCompleted (const QUrl &url)
 Emitted when the upload has completed successfully.
void uploadError (QStringList errorMessages)
 Emitted when an error makes the upload fail.
void uploadExited ()
 Emitted always when the uploader exits.
void uploadProgress (qint64 bytesSent, qint64 bytesTotal)
 Emitted when data are ready to be processed.

Public Member Functions

 QgsFileUploader (const QString &uploadFileName, const QUrl &url, const QString &formName=QString(), const QString &authcfg=QString(), bool delayStart=true)
 QgsFileUploader.

Protected Member Functions

 ~QgsFileUploader () override

Detailed Description

A utility class for uploading files.

To use this class, it is necessary to pass the URL and a the file name of the file to upload as arguments to the constructor, the upload will start immediately.

The upload is asynchronous.

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

Since
QGIS 4.2

Definition at line 41 of file qgsfileuploader.h.

Constructor & Destructor Documentation

◆ QgsFileUploader()

QgsFileUploader::QgsFileUploader ( const QString & uploadFileName,
const QUrl & url,
const QString & formName = QString(),
const QString & authcfg = QString(),
bool delayStart = true )

QgsFileUploader.

Parameters
uploadFileNamefile name of the file to upload to the server
urlthe upload URL
formNamethe upload URL
authcfgoptionally apply this authentication configuration
delayStartif true, the download will not be commenced immediately and must be triggered by a later call to startUpload(). This can be useful to setup connections

Definition at line 36 of file qgsfileuploader.cpp.

◆ ~QgsFileUploader()

QgsFileUploader::~QgsFileUploader ( )
overrideprotected

Definition at line 49 of file qgsfileuploader.cpp.

Member Function Documentation

◆ cancelUpload

void QgsFileUploader::cancelUpload ( )
slot

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

See also
uploadCanceled()

Definition at line 120 of file qgsfileuploader.cpp.

◆ startUpload

void QgsFileUploader::startUpload ( )
slot

Called to start the upload.

Definition at line 52 of file qgsfileuploader.cpp.

◆ uploadCanceled

void QgsFileUploader::uploadCanceled ( )
signal

Emitted when the upload was canceled by the user.

See also
cancelUpload()

◆ uploadCompleted

void QgsFileUploader::uploadCompleted ( const QUrl & url)
signal

Emitted when the upload has completed successfully.

◆ uploadError

void QgsFileUploader::uploadError ( QStringList errorMessages)
signal

Emitted when an error makes the upload fail.

◆ uploadExited

void QgsFileUploader::uploadExited ( )
signal

Emitted always when the uploader exits.

◆ uploadProgress

void QgsFileUploader::uploadProgress ( qint64 bytesSent,
qint64 bytesTotal )
signal

Emitted when data are ready to be processed.


The documentation for this class was generated from the following files: