error on deleting file in ftp

aoshi_kh

Member
Joined
Jun 17, 2016
Messages
6
Programming Experience
Beginner
I was using SharpSsh for sftp in my vb coding, it was working good for upload and download file.
But when I trying to delete file from sftp server with below code, it keep hit error of Invalid URI error.
Anyone know how should I fix this?


PHP:
Dim ftpRequest As FtpWebRequest = DirectCast(WebRequest.Create(_ftpURL & _ftpDirectory & FileName), FtpWebRequest)  'the url like this -- sftp.xxxx.com/testing/Delete/testfile1.txt
               ftpRequest.Credentials = New NetworkCredential(_UserName, _Password)
                ftpRequest.Method = WebRequestMethods.Ftp.DeleteFile
                Dim responseFileDelete As FtpWebResponse = DirectCast(ftpRequest.GetResponse(), FtpWebResponse)
 
Back
Top