That does help, thank you! What you are looking for is a way to "stream" the download to the end user. I don't know of a way off-hand to do this in R, but hopefully someone else will have some ideas.
Basically, what I understand is happening is:
- user requests file
- R reads entire file into memory
- R delivers file to end user
What you want is:
- user requests file
- R starts reading and starts delivering file to end user
- R continues this process until file is fully transferred
- R never holds more than X bytes in memory at once
Though I do not know a way to do this in R, there are plenty of other web-servers / file handlers that do this sort of thing well. I.e. you could use apache
or nginx
, or any other web server you are familiar with. You would just hand the user a URL: http://site.com/path/to/file.tar.gz
for them to download the file using a different web server, rather than a relative path to a file on disk.
It definitely is an interesting feature request for the download handler in Shiny, though, if the option does not exist already! Again, you're looking for a streaming download or something of that nature.
Alternatively, you may think about other ways of transferring such a massive file (SSH, chopping it up, paring it down, etc.) 