Learn R Programming

SpaDES.core (version 0.2.4)

remoteFileSize: Determine the size of a remotely hosted file

Description

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

Usage

remoteFileSize(url)

Arguments

url

The url of the remote file.

Value

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

Examples

Run this code
# NOT RUN {
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)) ## 5429, 3997384, 0

# }

Run the code above in your browser using DataLab