PoshCode Archive  Artifact [8fcb923861]

Artifact 8fcb9238612212233f74a28cb8b57ffe928f719199097492b21da72f1d1a93da:

  • File FTP-upload.ps1 — part of check-in [443d9d9008] at 2018-06-10 14:19:26 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: 6697
# x-archived: 2017-01-24T08:48:33
# x-published: 2017-01-18T08:06: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)