Search notes:

R function: download.file

download.file can be used to download a file from the internet.
fileUrl <- 'https://raw.githubusercontent.com/ReneNyffenegger/about-r/master/functions/download.file.R';

dest <- paste0(Sys.getenv('TEMP'), '/download.file.R');
download.file(fileUrl, destfile = dest);

fileContent <- readLines(dest);

writeLines(fileContent);
Github repository about-r, path: /functions/download.file.R

Binary files on Windows

In order to download binary files on Windows, the parameter mode should be set to "wb".

See also

Index to (some) R functions

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1745469652, '18.216.67.249', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/languages/R/functions/download_file(53): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78