param(
[string]$cCONAME="oconee"
)

#we specify the directory where all files that we want to upload  
$Dir="\\ocsql23\tco\gatcs\exports\dt_vendor\"    


#ftp server 
$ftp = "ftp://ftp.gatcs.net/public_html/county/"+$cCONAME+"/" 
$user = "atthomas@gatcs.net" 
$pass = "DOR@gent007"  

$webclient = New-Object System.Net.WebClient 

$webclient.Credentials = New-Object System.Net.NetworkCredential($user,$pass)  

#list every sql server trace file 
foreach($item in (dir $Dir "dt_vendorlist.xls")){ 
    "Uploading $item..." 
    $uri = New-Object System.Uri($ftp+$item.Name) 
    $webclient.UploadFile($uri, $item.FullName) 
 } 

