PoshCode Archive  Artifact [4c37dd9c20]

Artifact 4c37dd9c20e1b8d875c09d8926a74a8ae1c1ab6df9c3d26c084efd8ce5cd1716:

  • File FTP-upload.ps1 — part of check-in [ebb80f67d4] at 2018-06-10 13:47:17 on branch trunk — quick hard coded script for uploading a file to an ftp server. (user: cofgis size: 564)

# encoding: ascii
# api: powershell
# title: FTP upload
# description: quick hard coded script for uploading a file to an ftp server.
# version: 0.1
# author: cofgis
# license: CC0
# x-poshcode-id: 4874
# x-archived: 2014-02-07T23:47:50
# x-published: 2014-02-03T23:50: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)