I've tried a couple of different scripts I've found online, and I thought I had one working, but find myself back at square one.
I landed on this one today, ran it from my workstation, pointing to the remote file, and it worked.
I placed the script on the server, where it will be automated, and it writes the data, but once the rs closes, the file is gone...I have no idea why?
$ftpFile = 'ftp://destination/folder/filename.csv'
$ftp = [System.Net.FtpWebRequest]::Create($ftpFile)
$ftp = [System.Net.FtpWebRequest]$ftp
$ftp.Method = [System.Net.WebRequestMethods+Ftp]::UploadFile
$ftp.Credentials = new-object System.Net.NetworkCredential('xxxxxxx',xxxxxx')
$ftp.UseBinary = $true
$ftp.UsePassive = $true
$content = [System.IO.File]::ReadAllBytes($file)
$ftp.ContentLength = $content.Length
$rs = $ftp.GetRequestStream()
$rs.Write($content, 0, $content.Length)