This function uploads a local file (png, pdf, or other media) via API
upload_file_to_site(local_file_path, file_summary = "", parent_page_id = "", overwrite = TRUE, site_domain = getOption("googlesites.site_domain"), site_name = getOption("googlesites.site_name"))
local_file_path | A string representing a local file path where the target file exists to be uploaded |
---|---|
file_summary | A string an (optional) description of the attachment when created |
parent_page_id | A string representing the absolute URL that identifies the entry id of a webpage
where the uploaded file will be attached. This should be an absolute URL looking like:
https://sites.google.com/feeds/content/mydomain/mysite/6477233125232797597. You can find this URL
by using the |
overwrite | A logical value. TRUE means that the function will identify and overwrite any Google Site attachments that exists with the same name (case-insensitive). FALSE means fail whenever a conflicting attachment name exists on the site |
site_domain | A string representing 'site' or the domain of your Google Apps hosted domain (e.g. example.com) |
site_name | A string representing the webspace name of your site; found in the Site's URL (e.g. myCoolSite) |
utils.R
A list of length two consisting of a URL for the created attachment and the Google Sites Entry ID
# NOT RUN { file <- upload_file_to_site(local_file_path='./files/test.png') # }