PoshCode Archive  Artifact [c6b31b683e]

Artifact c6b31b683e4543f68132de477b890f3235c955064f75dabb1e4ca6226abd2947:

  • File FTP-upload.ps1 — part of check-in [55e695d458] at 2018-06-10 14:04:02 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: 5916
# x-archived: 2016-06-27T19:53:31
# x-published: 2016-07-01T15:53: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)