View source: R/handle_ru_attachments.R
handle_ru_attachments | R Documentation |
handle_ru_attachments(
data,
form_schema,
local_dir = "media",
pid = get_default_pid(),
fid = get_default_fid(),
url = get_default_url(),
un = get_default_un(),
pw = get_default_pw(),
retries = get_retries(),
verbose = get_ru_verbose()
)
data |
Submissions rectangled into a tibble. E.g. the output of ruODK::odata_submission_get(parse = FALSE) %>% ruODK::odata_submission_rectangle() |
form_schema |
The |
local_dir |
The local folder to save the downloaded files to, default: "media". |
pid |
The numeric ID of the project, e.g.: 2. Default: Set default See |
fid |
The alphanumeric form ID, e.g. "build_Spotlighting-0-8_1559885147". Default: Set default See |
url |
The ODK Central base URL without trailing slash. Default: Set default See |
un |
The ODK Central username (an email address).
Default: |
pw |
The ODK Central password.
Default: |
retries |
The number of attempts to retrieve a web resource. This parameter is given to Default: 3. |
verbose |
Whether to display debug messages or not. Read |
For a given tibble of submissions, download and link attachments for all columns which are marked in the form schema as type "binary".
The submissions tibble with all attachments downloaded and linked to
a local_dir
.
Other utilities:
attachment_get()
,
attachment_link()
,
attachment_url()
,
drop_null_coords()
,
form_schema_parse()
,
get_one_attachment()
,
get_one_submission()
,
get_one_submission_att_list()
,
get_one_submission_audit()
,
handle_ru_datetimes()
,
handle_ru_geopoints()
,
handle_ru_geoshapes()
,
handle_ru_geotraces()
,
isodt_to_local()
,
odata_submission_rectangle()
,
predict_ruodk_name()
,
prepend_uuid()
,
split_geopoint()
,
split_geoshape()
,
split_geotrace()
,
strip_uuid()
,
tidyeval
,
unnest_all()
## Not run:
library(magrittr)
data("fq_raw")
data("fq_form_schema")
t <- tempdir()
fs::dir_ls(t) %>% fs::file_delete()
fq_with_att <- fq_raw %>%
ruODK::odata_submission_rectangle() %>%
ruODK::handle_ru_attachments(
form_schema = fq_form_schema,
local_dir = t,
pid = ruODK::get_test_pid(),
fid = ruODK::get_test_fid(),
url = ruODK::get_test_url(),
un = ruODK::get_test_un(),
pw = ruODK::get_test_pw(),
verbose <- ruODK::get_ru_verbose()
)
# There should be files in local_dir
testthat::expect_true(fs::dir_ls(t) %>% length() > 0)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.