I am working my way through a piece of code debugging it
Dim FTPServer As String = "ftp://ukftp.alyanto.com"
Dim UserName As String = "alyanto"
Dim Password As String = "expertsexchange"
Dim FilePath As String = "C:\Users\tongcheeka\Documents\Adware\ScannerImport\FTPExport\Bad00021032014141633.csv"
Dim oURI As New System.Uri(FTPServer)
Dim fwr As FtpWebRequest = DirectCast(FtpWebRequest.Create(oURI), FtpWebRequest)
fwr.Method = WebRequestMethods.Ftp.UploadFile
fwr.Credentials = New NetworkCredential(.UserName, Password)
fwr.Proxy = Nothing
fwr.UsePassive = False
Dim reader As New FileStream(oFTP.SourceFile, FileMode.Create, FileAccess.ReadWrite)
Dim buffer(Convert.ToInt32(reader.Length - 1)) As Byte
reader.Read(buffer, 0, buffer.Length)
fwr.ContentLength = buffer.Length
Dim stream As Stream = fwr.GetRequestStream
stream.Write(buffer, 0, buffer.Length)
Catch ex As Exception
At Dim stream As Stream = fwr.GetRequestStream
it throws this error
'The requested URI is invalid for this FTP command.
The team I am with believe the URL we are using is correct. I can use it to navigate to using the URL via windows. I suspect it is some combination of the URL and file name I need but I keep finding myself at a dead end.
Can someone make suggestion on how I might resolve the issue?