PoshCode Archive  Artifact [2198f3c464]

Artifact 2198f3c464506dbd2fb4d7e6180e367ec7af47377fd9b281d298608bda5e807e:

  • File FTP-download.ps1 — part of check-in [56aeba2927] at 2018-06-10 13:18:39 on branch trunk — quick hard coded script for uploading a file to an ftp server. (user: Stephen Price size: 573)

# encoding: ascii
# api: powershell
# title: FTP download
# description: quick hard coded script for uploading a file to an ftp server.
# version: 0.1
# author: Stephen Price
# license: CC0
# x-poshcode-id: 3004
# x-archived: 2017-04-01T12:46:38
# x-published: 2012-10-14T14:07: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)