28.1.4. File tools
28.1.4.1. Download file
Downloads a file specified using a URL (using for instance http:
or file:
).
In other words you can copy/paste a URL and download the file.
Parameters
Basic parameters
Label |
Name |
Type |
Description |
---|---|---|---|
URL |
|
[string] |
The URL of the file to download. |
File destination Optional |
|
[string] Default: |
Specification of the file destination. One of:
|
Advanced parameters
Label |
Name |
Type |
Description |
---|---|---|---|
Method |
|
[enumeration] Default: 0 |
The HTTP method to use for the request. Options are:
|
Data Optional |
|
[string] |
The data to add in the body if the request is a POST. |
Outputs
Label |
Name |
Type |
Description |
---|---|---|---|
File destination |
|
[string] |
The location of the downloaded file |
Python code
Algorithm ID: qgis:filedownloader
import processing
processing.run("algorithm_id", {parameter_dictionary})
The algorithm id is displayed when you hover over the algorithm in the Processing Toolbox. The parameter dictionary provides the parameter NAMEs and values. See Using processing algorithms from the console for details on how to run processing algorithms from the Python console.
28.1.4.2. Open file or URL
Opens files in their default associated application, or URLs in the user’s default web browser.
Parameters
Label |
Name |
Type |
Description |
---|---|---|---|
URL or file path |
|
[string] |
The URL or path of the file to open. |
Outputs
The algorithm has no output.
Python code
Algorithm ID: native:openurl
import processing
processing.run("algorithm_id", {parameter_dictionary})
The algorithm id is displayed when you hover over the algorithm in the Processing Toolbox. The parameter dictionary provides the parameter NAMEs and values. See Using processing algorithms from the console for details on how to run processing algorithms from the Python console.