PoshCode Archive  Artifact [49c118e79c]

Artifact 49c118e79ca65a879215ea88fe620c6287193bf9ff1941b3cc92881b23126bcd:

  • File FTP-upload.ps1 — part of check-in [d0c02d2874] at 2018-06-10 13:14:43 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: 2710
# x-archived: 2016-11-18T00:58:17
# x-published: 2011-06-06T16:05: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)