# encoding: ascii
# api: powershell
# title: FTP upload
# description: how can we zip and upload a file to a FTP cloud through powershell?
# version: 0.1
# author: Stephen Price
# license: CC0
# x-poshcode-id: 4714
# x-archived: 2016-06-28T02:20:12
# x-published: 2016-12-19T07:34:00
#
# please help me.
# thanks
#
$File = "D:\Dev\somefilename.zip"
$ftp = "ftp://username:password@example.com/pub/incoming/somefilename.zip"

"ftp url: $ftp"

$webclient = New-Object System.Net.WebClient
$uri = New-Object System.Uri($ftp)

"Uploading $File..."

$webclient.UploadFile($Uri, $File)
