PoshCode Archive  Artifact [fec58ef485]

Artifact fec58ef485569403744e8ba17911e814c1337e54d6978bc40a0ae03845818208:

  • File FTP-upload.ps1 — part of check-in [35a43669a4] at 2018-06-10 13:56:23 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: 5509
# x-archived: 2014-10-16T21:53:48
# x-published: 2014-10-14T06: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)