PoshCode Archive  Artifact [a13fe11510]

Artifact a13fe1151033e6c9112e621159d77266f8b13be7ee720e63114691ecca504a12:

  • File FTP-upload.ps1 — part of check-in [622cb47492] at 2018-06-10 12:56:30 on branch trunk — quick hard coded script for uploading a file to an ftp server. (user: Stephen Price size: 598)

# 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: 1134
# x-derived-from-id: 3972
# x-archived: 2017-05-11T14:49:53
# x-published: 2010-05-27T21:52: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)