0

I am trying to download files from an internal website using download.file.

It works fine for the most time and I know, on the back end, it is built on SQL.

However, if the SQL query takes too long time to execute (for example if I increase the number of years), it throws the error message below.

(If I open the download path directly in a web browser, it will show a blank screen, and after 5 minutes or so, it will start to download the file)

Error in download.file(., destfile = path,  :
  cannot open URL ''
In addition: Warning message:
In download.file(., destfile = path,  :
  InternetOpenUrl failed: 'The operation timed out'

I want to know if there is a way I can increase the time out limit, so download.file can wait until the query ends.

(I cannot access the database or change the query directly)


Attempts:

  • options(timeout = 100000000) does not work
  • options(windowsTimeouts = 100000000) does not work
  • cacheOK = FALSE does not work
  • RCurl::curlSetOpt(timeout = 100000000) does not work

Updates:

1 Answers1

0

With the inspiration of Internet Explorer error "connection timed out" when server does not respond, I have resolved my issue. In case anyone is interested, I will answer my question here.

Below is the archive if the link failed.

  1. Start Registry Editor.
  2. Locate the following subkey: HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings
  3. In this subkey, add a ReceiveTimeout DWORD entry that has a value of ()*1000. For example, if you want the time-out duration to be 8 minutes, set the value of the ReceiveTimeout entry to 480000 (<480>*1000).
  4. Restart the computer.