Query a remote web server to determine the size of a remote file.

remoteFileSize(url)

Arguments

url

The url of the remote file.

Value

A numeric indicating the size of the remote file in bytes.

Examples

urls <- c("https://www.alexchubaty.com/uploads/2011/11/open-forest-science-journal.csl", "https://www.alexchubaty.com/uploads/2011/08/models_GUI_2011-08-07.zip", "http://example.com/doesntexist.csv") try(remoteFileSize(urls))
#> https://www.alexchubaty.com/uploads/2011/11/open-forest-science-journal.csl #> 5429 #> https://www.alexchubaty.com/uploads/2011/08/models_GUI_2011-08-07.zip #> 3997384 #> http://example.com/doesntexist.csv #> 0