i’m trying to use powershell to take image from specified url and resend it to ftp.
But it doesn’t work this way :/
$url = "http://somesite.com/image.jpg"
$ftp = "ftp://username:password@hostname.com/folder/image.jpg"
$webclient = New-Object System.Net.WebClient
$uri = New-Object System.Uri($ftp)
$webclient.UploadFile($uri, $url)
Any tips?
Thanx!
The WebClient and FtpWebRequest class in .NET (and consequently PowerShell) don’t support the File eXchange Protocol (FXP) – as such you will need to download the source file to your computer first, then transfer the file over FTP to your destination: