2 Replies Latest reply: May 15, 2014 10:01 AM by Gareth Horton RSS

    Automate downloading a file from a website

    joey

      Every year a state agency provides updated territory codes via a PDF document that is available on their website.

       

      We have a very manual process to update our edit tables. This is going to be replaced with Data Pump. I am able to automate all of the report, with the exception of downloading the PDF from the state website at the beginning of the process.

       

      Does anyone have any ideas for how to download a file from a website automatically?

       

      The URL of the document I need is http://www.ticostat.com/ResiDocs/PlaceWeb.pdf[/URL], if it helps.

       

      Thanks for any ideas!

       

       

      Update:

      I found that the input for a project can be a URL, so I can use the file directly!  Very nice!  I'm still open to ideas for how to download the file.

        • Automate downloading a file from a website
          Nick Osdale-Popa

          We do this every Tuesday with an Access .mdb file of new construction.  I use url=http://www.gnu.org/software/wget/Wget[/url] for automating of the download. Then I process the .mdb through Monarch to only extract the columns and rows that apply to us.

          • Automate downloading a file from a website
            Gareth Horton

            Joey,

             

            You can do this in a Pre-Process or Pre-Export Script with VB.NET.

             

             

            Dim wc As New System.Net.WebClient()

            Dim Download as Boolean

             

            try

             

                 wc.DownloadFile("http://webserver/server_out/classic.prn", "c:\inbox\datapump\classic.prn")

                 Download = true

            catch e As System.Net.WebException

             

            Log.AddEvent("Download failed")

            Download = False

             

            end try

             

            If Download = True then

                 Log.AddEvent("Downloaded file successfully")

            End if

             

            /CODE

             

            Every year a state agency provides updated territory codes via a PDF document that is available on their website.

             

            We have a very manual process to update our edit tables. This is going to be replaced with Data Pump. I am able to automate all of the report, with the exception of downloading the PDF from the state website at the beginning of the process.

             

            Does anyone have any ideas for how to download a file from a website automatically?

             

            The URL of the document I need is http://www.ticostat.com/ResiDocs/PlaceWeb.pdf[/URL], if it helps.

             

            Thanks for any ideas!

             

             

            Update:

            I found that the input for a project can be a URL, so I can use the file directly!  Very nice!  I'm still open to ideas for how to download the file.[/QUOTE]