mdl_resource_upload_file_and_link: Upload a file and create a resource linked to it

View source: R/resource.R

mdl_resource_upload_file_and_linkR Documentation

Description

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.

Usage

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
)

Arguments

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

Value

API call response.


UNHCRmdl/mdl documentation built on Jan. 15, 2025, 6:40 p.m.