doc_download: Document Download

View source: R/doc_download_function.R

doc_downloadR Documentation

Document Download

Description

This function downloads a file to the specified location. It's a wrapper for download.file and helps extract lots of files into ordered directory trees. Use with doc_meta_extract and doc_getlink for best results.

Usage

doc_download(doc_id, mkey, dl_loc, filename, doc_type)

Arguments

doc_id

Document number

mkey

Authorisation key

dl_loc

The location you want to download the file to, ending in a '/'. Directories will be created recursively if they don't exist

filename

The name you want to give the file

doc_type

The filetype of the document. Should be one of 'application/pdf', 'application/json', 'application/xml', 'application/xhtml+xml' or 'text/csv'

Value

Downloads the file to the location specified in the specified format. Expect warning messages for directories that exist


MatthewSmith430/CompaniesHouse documentation built on Jan. 28, 2024, 3:08 a.m.