PoshCode Archive  Artifact [b2aab7e93c]

Artifact b2aab7e93c0d873a1954fb5983ec442915c4a059351187f8587540f815d15ee9:

  • File FTP-upload.ps1 — part of check-in [d44ff18ba6] at 2018-06-10 13:49:29 on branch trunk — quick hard coded script for uploading a file to an ftp server. (user: Stephen Price size: 571)

# encoding: ascii
# api: powershell
# title: FTP upload
# description: quick hard coded script for uploading a file to an ftp server.
# version: 0.1
# author: Stephen Price
# license: CC0
# x-poshcode-id: 5060
# x-archived: 2016-11-18T01:27:41
# x-published: 2016-04-08T09:57:00
#
#
$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)