|  | 
| 1 | 1 | % File src/library/utils/man/download.file.Rd | 
| 2 | 2 | % Part of the R package, https://www.R-project.org | 
| 3 |  | -% Copyright 1995-2024 R Core Team | 
|  | 3 | +% Copyright 1995-2025 R Core Team | 
| 4 | 4 | % Distributed under GPL 2 or later | 
| 5 | 5 | 
 | 
| 6 | 6 | \name{download.file} | 
| @@ -133,6 +133,21 @@ download.file(url, destfile, method, quiet = FALSE, mode = "w", | 
| 133 | 133 |   } | 
| 134 | 134 |   (It is unrealistic to require download times of less than 1s/MB.) | 
| 135 | 135 | 
 | 
|  | 136 | +  A HTTP[S] URL may require authentication.  One may specify a username and | 
|  | 137 | +  password as part of the URL, i.e.  | 
|  | 138 | +  \code{"https://username:password@machine/..."}.  This is not recommended | 
|  | 139 | +  with HTTP as the credentials will be sent in plaintext.  With HTTPS, they | 
|  | 140 | +  will be encrypted, but still may appear in plaintext e.g.  in server logs.  | 
|  | 141 | +  Alternatively, the credentials may be specified via \code{Authorization} | 
|  | 142 | +  in argument \code{headers}, but that is more involved for the user and | 
|  | 143 | +  wouldn't allow simultaneous download from different URLs requiring | 
|  | 144 | +  authentication.  With \code{"libcurl"}, it is possible to have the | 
|  | 145 | +  credentials in a netrc file which can be specified by the option | 
|  | 146 | +  \code{netrc} and the default may be set by the environment variable | 
|  | 147 | +  \env{R_DEFAULT_NETRC}.  The file should not be readable by other users.  | 
|  | 148 | +  See \url{https://everything.curl.dev/usingcurl/netrc.html} for further | 
|  | 149 | +  details. | 
|  | 150 | +
 | 
| 136 | 151 |   The level of detail provided during transfer can be set by the | 
| 137 | 152 |   \code{quiet} argument and the \code{internet.info} option: the details | 
| 138 | 153 |   depend on the platform and scheme.  For the \code{"libcurl"} method | 
|  | 
0 commit comments