PoshCode Archive  Artifact [c27ceb9646]

Artifact c27ceb964654031b30c18cd2bfacec0306d7deb3939d5a951c9ea908c331b67c:

  • File FTP-upload.ps1 — part of check-in [3c8d8a8d24] at 2018-06-10 14:16:56 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: 6494
# x-archived: 2016-09-03T23:43:21
# x-published: 2016-08-30T00:28: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)