create_temporarily_download_url()

Create a temporarily download url

create_temporarily_download_url()

Create a temporarily download url for a file or folder.

Parameters

Name
Type
Description

$id

string

ID of the entry

Return

Name
Type
Description

$url

string

A temporarily download link for the requested file or folder. The link is valid for ~ 15 minutes.

Usage

WPCP_ONEDRIVE_API::set_account_by_id('8c9bacda0-d8d8-4b22-b634-7b5281687575');
WPCP_ONEDRIVE_API::set_drive_by_id('b!DlaHWskCed_MIid3KpJH5Lbatf9HsdXBAZH5YcvPAbMhJUKzTJyzgvXZYpBS');

// Create temporarily download url
$temporarily_url = WPCP_ONEDRIVE_API::create_temporarily_download_url('01EXLSWHRCD7RDL3HX65BK5X3ULXLWSICN');

// Redirect user to download url
header('Location: '.$temporarily_url);
exit;

Last updated