sf_download_attachment | R Documentation |
This function will allow you to download an attachment to disk based on the attachment body, file name, and path.
sf_download_attachment( body, name = NULL, sf_id = NULL, object_name = c("Attachment", "Document"), path = "." )
body |
|
name |
|
sf_id |
|
object_name |
|
path |
|
character
; invisibly return the file path of the downloaded
content
Other Attachment functions:
check_and_encode_files()
,
sf_create_attachment()
,
sf_delete_attachment()
,
sf_update_attachment()
## Not run: # downloading all attachments for a Parent record # if your attachment name doesn't include the extension, then you can use the # ContentType column to append it to the Name, if needed queried_attachments <- sf_query("SELECT Id, Body, Name, ContentType FROM Attachment WHERE ParentId = '0016A0000035mJ5'") mapply(sf_download_attachment, queried_attachments$Body, queried_attachments$Name) # downloading an attachment by its Id # (the file name will be the same as it exists in Salesforce) sf_download_attachment(sf_id = queried_attachments$Id[1]) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.