get_one_attachment | R Documentation |
get_one_attachment(
pth,
fn,
src,
url = get_default_url(),
un = get_default_un(),
pw = get_default_pw(),
retries = get_retries(),
verbose = get_ru_verbose()
)
pth |
A local file path to save the attachment to. |
fn |
The attachment filename, as per ODK form submission. If NA, no file will be downloaded, but NA will be returned. If the file does not exist in ODK Central, a warning will be emitted. |
src |
The attachment's download URL, generated by
|
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 |
This is a helper function used by attachment_get
.
This function is not vectorised, but mapped by attachment_get
to a tibble of input parameters.
The relative local path to the downloaded attachment or NA.
Other utilities:
attachment_get()
,
attachment_link()
,
attachment_url()
,
drop_null_coords()
,
form_schema_parse()
,
get_one_submission()
,
get_one_submission_att_list()
,
get_one_submission_audit()
,
handle_ru_attachments()
,
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:
# Step 1: Setup ruODK with OData Service URL (has url, pid, fid)
# See vignette("setup") for setup and authentication options
# ruODK::ru_setup(svc = "....svc", un = "me@email.com", pw = "...")
# Step 2: Construct attachment_url
att_url <- ruODK:::attachment_url(
"uuid:d3bcefea-32a8-4dbc-80ca-4ecb0678e2b0",
"filename.jpg"
)
# Step 3: Get one attachment
local_fn <- get_one_attachment("media/filename.jpg", "filename.jpg", att_url)
# In real life: done in bulk behind the scenes during odata_submission_get()
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.