FtpWebRequest.Method = "UploadFile"
How to get around of this? could not find anything about this on web.
Thanks,
Public
Dim requestAs FtpWebRequest =Nothing
Dim responseAs FtpWebResponse =NothingDim srAs StreamReader =NothingDim swAs StreamWriter =NothingTryrequest =
CType(FtpWebRequest.Create(New Uri(uploadAddress)), FtpWebRequest)request.Method =
"UploadFile"request.Credentials = credentials
sw =
New StreamWriter(request.GetRequestStream, Encoding.ASCII)sr =
New StreamReader(fileToUpload)sw.Write(sr.ReadToEnd)
'Console.WriteLine("Uploading file " + uploadAddress)response =
CType(request.GetResponse, FtpWebResponse)'Console.WriteLine("Status of upload: " + response.StatusDescription)Catch exAs UriFormatExceptionThrowNew ApplicationException("FTP address is not correct." & uploadAddress)Catch exAs WebExceptionThrowNew ApplicationException("FtpUpload Failed: " & ex.Message, ex)Catch exAs ExceptionThrow exFinallyIf responseIsNotNothingThen response.Close()If srIsNotNothingThen sr.Close()If swIsNotNothingThen sw.Close()EndTryEndSub
