PoshCode Archive  Artifact [86d3d05af7]

Artifact 86d3d05af7a811a0f1efc4f56626626fe730e4b56afa53bb65d78910b14a4a75:

  • File FTP-upload.ps1 — part of check-in [53b33c72c4] at 2018-06-10 14:16:07 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: 6451
# x-archived: 2016-07-27T03:02:30
# x-published: 2016-07-20T11:39: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)