WPDev.one
Core Function
View Source on Trac ↗

download_url()

download_url( mixed $url, mixed $timeout = 300, mixed $signature_verification = false )

Downloads a URL to a local temporary file using the WordPress HTTP API.

Parameters 3 required

Name / Type Description
$url
string

The URL of the file to download.

Required
int

$timeout The timeout for the request to download the file. Default 300 seconds.

Required
bool

$signature_verification Whether to perform Signature Verification. Default false.

Required

Return Value

((string)
| WP_Error) Filename on success, WP_Error on failure.

Function Information

Since Version
2.5.0
Source File
wp-admin/includes/file.php
Advertisement