viewpoint-particle

Author Topic: Is there a way to copy a file from a web link?  (Read 422 times)

limnos

  • Newbie
  • *
  • Posts: 18
Is there a way to copy a file from a web link?
« on: November 16, 2018, 08:52:34 am »
I need to copy a zip down from a link like this https://stuff.stuff.stuff/Content/doc/stuff.zip.  I'm sure I'm over looking some object call I can use.  I already leverage a subroutine to open a browser session with the Object.open("InternetExplorer.Application") call, so I assume there's some object I can use to copy a file from a browser location?  Any help or advise would be appreciated.  Thanks.


limnos

  • Newbie
  • *
  • Posts: 18
Re: Is there a way to copy a file from a web link?
« Reply #2 on: November 16, 2018, 11:18:38 am »
Yup, that's the ticket.  Thanks, just wasn't searching in the right place.

grantwilson

  • Newbie
  • *
  • Posts: 1
  • just Grant
Re: Is there a way to copy a file from a web link?
« Reply #3 on: January 15, 2019, 10:40:35 pm »

Re: Is there a way to copy a file from a web link?

I need to copy a zip down from a link like this https://stuff.stuff.stuff/Content/doc/stuff.zip.  I'm sure I'm over looking some object call I can use.  I already leverage a subroutine to open a browser session with the Object.open("InternetExplorer.Application") call, so I assume there's some object I can use to copy a file from a browser location?  Any help or advise would be appreciated.  Thanks.

Hi there,

Is it possible to use Invoke-WebRequest with PowerShell 3.0 alternatively? I've been searching for the answer on Stackoverflow:
Code: [Select]
Invoke-WebRequest http://www.example.com/package.zip -OutFile package.zip

Thanks.

stanl

  • Pundit
  • *****
  • Posts: 934
Re: Is there a way to copy a file from a web link?
« Reply #4 on: January 16, 2019, 03:49:25 am »
Of course you can. It may be a little slow depending on size of the zip. But if you want to keep it all in WB (especially if future operations on the zip are required) the HTTPS previously suggested will work, or you can leverage WB's CLR and use


System.Net.WebClient.DownloadFile(uri, output) -

http://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/getarticle.web+WinBatch/dotNet/System_Net+DownloadFile.txt

Then there is BITS - but someone with more knowledge will have to chime in and explain it.