mdl_resource_upload_file_and_link | R Documentation |
This function first uploads a file for a given survey, then creates a resource and link it to the uploaded file. The name of the file works as an identifier, meaning that uploading another file with the same name will overwrite the file and the resource.
mdl_resource_upload_file_and_link(
survey_idno,
file_path,
enum_resource_type,
title,
description = NULL,
enum_resource_format = NULL,
author = NULL,
dcdate = NULL,
country = NULL,
language = NULL,
contributor = NULL,
publisher = NULL,
rights = NULL,
abstract = NULL,
toc = NULL,
overwrite = FALSE
)
survey_idno |
The unique identifier of an existing survey, e.g.: UNHCR_ETH_2020_SENS_v2.1 |
file_path |
Path to the file to upload, e.g.: C:/path/to/file.pdf |
enum_resource_type |
The type of resource. We recommend to use the corresponding enumerator, e.g.: mdl_enum_resource_type$doc_report |
title |
Title of the resource as shown in the platform to the final user. |
description |
Brief description of the resource as shown in the platform to the final user. |
enum_resource_format |
Resource file format. We recommend to use the corresponding enumerator, e.g.: mdl_enum_resource_format$Document_PDF |
author |
Author name |
dcdate |
Date using YYYY-MM-DD format |
country |
Country name |
language |
Language or Language code |
contributor |
Contributor name |
publisher |
Publisher name |
rights |
Rights |
abstract |
Resource abstract |
toc |
Table of contents |
overwrite |
Boolean, specifies if the file/resource should be overwritten if already present |
API call response.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.