Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • URL Download Copy Command

    I am trying to download a file from an https:// webpage. The type of file I am trying to download is the type you click on and then it asks you to save the file.

    For reference, the file I am trying to download is from the Phl Fed's webpage: https://www.philadelphiafed.org/rese...dian-forecasts. I am trying to download the 'Median Forecast Data for Levels' file. url: "https://www.philadelphiafed.org/-/media/research-and-data/real-time-center/survey-of-professional-forecasters/historical-data/medianlevel.xls?la=en".

    I have been trying to use the view / copy commands:

    copy "https://www.philadelphiafed.org/-/media/research-and-data/real-time-center/survey-of-professional-forecasters/historical-data/medianlevel.xls?la=en" "c:\temp\medianlevel.xls"
    Error: remote connection failed -- see help r(677) for troubleshooting r(677);

    Can someone please help me with writing the command for this?

  • #2
    It's not the command; it's your connection. As you cite,

    . error 677
    remote connection failed -- see help r(677) for troubleshooting
    r(677);

    Do you have Stata 14 or an older version? Have you checked

    Code:
    help netio
    ?

    "Izzy Econ": if that is your real name, fine. Otherwise, please note http://www.statalist.org/forums/help#realnames

    Comment


    • #3
      I understand the error code implies it is a connection error, but I think it is actually timing out from an invalid url code. I think it is unable to load the url which causes it to timeout, not that there is an issue with the conneciton.
      I had used the 'help netio' code and have played around with the http proxies, but I still get the same error message.

      Comment


      • #4
        It seems to work for me; the file downloaded with no problem.

        Comment


        • #5
          The file download also works for me. You mentioned modifying the http proxy settings. Are you trying to download the file from a work pc? If so, do you use a proxy to connect to the internet? I ask because my organization's proxy was the culprit behind all of my past issues downloading files via Stata.

          If you are connecting through a proxy from work, have your local IT confirm that the proxy allows traffic sent using Stata's user-agent string.

          Some things to check before going to your IT department based on my experiences. The answers to these questions can help them diagnose the issue:

          - Can you download the file manually using an internet browser?

          - Can you use the copy command to download a file from a different https:\\ site? An http:\\ site?

          Comment


          • #6
            I agree with Chris. Locally, what turned out to be is crucial is to get three settings right.

            Code:
                Turn on or off the use of a proxy server
            
                    set httpproxy {on|off} [, init]
            
            
                Set proxy host name
            
                    set httpproxyhost ["]name["]
            
            
                Set the proxy port number
            
                    set httpproxyport #

            Comment

            Working...
            X