Announcement

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

  • download Zip file website

    Hi
    I want to download this Zip file from the website. But unable to download from within Stata command line. It's download able in browser but not from Stata Command line. Here is the URL of the file I want to download.

    URL= https://www.pbs.gov.pk/sites/default...lm_2019_20.zip


  • #2
    What command are you using in Stata, and what operating system are you on?

    Comment


    • #3
      This is what I see when I attempt to use the Stata unzipfile command to download the ZIP archive.
      Code:
      . unzipfile "https://www.pbs.gov.pk/sites/default/files//pslm/publications/pslm_2019_20_microdat
      > a/stata_data_pslm_2019_20.zip"
      ssl handshake error
          javax.net.ssl.SSLHandshakeException: PKIX path building failed:
          sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid
          certification path to requested target
      could not open url
      r(603);
      And the file is also successfully downloaded from a browser.

      What version of Stata are you using?
      Code:
      . about
      
      Stata/SE 17.0 for Mac (Apple Silicon)
      Revision 13 Oct 2022

      Comment


      • #4
        Originally posted by Hemanshu Kumar View Post
        What command are you using in Stata, and what operating system are you on?

        I am using Windows 10. And I used these commands

        Code:
        . cd "C:\Users\Ijaz Ali\Desktop"
        C:\Users\Ijaz Ali\Desktop
        
        . copy https://www.pbs.gov.pk/sites/default/files//pslm/publications/pslm_2019_20_microdata/stata_data_pslm_2019_20.zip stata_data_pslm_2019_20.zip
        ssl handshake error
            javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid
            certification path to requested target
        r(603);
        Last edited by Ijaz Ali; 21 Oct 2022, 11:57.

        Comment


        • #5
          At the following earlier topic, Stata Technical Services discusses two possible sources for the problem.

          https://www.statalist.org/forums/for...-error-message

          Comment


          • #6
            I want to download the zip file directly using Stata command.

            My Stata version:
            Code:
             
            . about
            
            Stata/MP 17.0 for Windows (64-bit x86-64)

            Comment


            • #7
              Originally posted by William Lisowski View Post
              At the following earlier topic, Stata Technical Services discusses two possible sources for the problem.

              https://www.statalist.org/forums/for...-error-message
              Thanks William Lisowski. After following the link you mentioned I tried the following and now I successfully downloaded the file.

              Code:
              . set sslrelax on
              Using set sslrelax on disables SSL certificate authentication.
              THIS SETTING SHOULD BE USED WITH EXTREME CAUTION.

              Comment


              • #8
                Thanks for letting us know what worked, and I'm glad it was the easy answer and not having to deal with a VPN. Before writing post #3 I'd searched the Statalist archives, but didn't choose a good search phrase, apparently, since a later search was successful and led to post #5. I'm for sure going to bookmark that discussion.

                Comment


                • #9
                  It would be advisable to re-enable normal SSL checks after your download for security purposes.

                  Comment


                  • #10
                    Originally posted by Leonardo Guizzetti View Post
                    It would be advisable to re-enable normal SSL checks after your download for security purposes.
                    Thanks for the valuable suggestion. I have now re-enable it.

                    Code:
                    . set sslrelax off
                    normal SSL certificate authentication has been reenabled.

                    Comment

                    Working...
                    X