View source: R/ns-attachment.R
ns_get_form_attachments | R Documentation |
Some Nettskjema have fields for attachments. These
can be downloaded through this function. There
are two naming convention that may be used for the
saved files' names. See output of
ns_list_submission_attachments
for idea
of the names used.
ns_get_form_attachments(
form_id,
filenames = c("standardized", "original"),
output_dir = "."
)
form_id |
integer. Number of the form to retrieve |
filenames |
Character of either 'standardized' (default) or 'original' indicating which file names to use. |
output_dir |
directory to output the files to |
filenames types
- uses file names are they were uploaded to Nettskjema
- creates file names based on the submission id and a counter number to uniquely create file names for each submission (in case there are more than one attachment)
invisible named logical if the file was saved successfully
## Not run:
form_id <- 1100000
ns_get_form_attachments(form_id)
# save files to specific folder
ns_get_form_attachments(form_id, output_dir = "~/Desktop")
# save using original file names
ns_get_form_attachments(form_id, filenames = "original")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.