Hello everyone, I am trying to create a folder on (www.upload.example.com) from my web application hosted on (www.example.com). Here is the code that created the folder:
Dim request As WebRequest = WebRequest.Create("ftp://example.com/upload.example.com/wwwroot/file/3")
request.Method = WebRequestMethods.Ftp.MakeDirectory
request.Credentials = New NetworkCredential("username", "password")
But I want to check through ftp if that directory exists before creating it. Using
If Not System.IO.Directory.Exists("ftp://example.com/upload.example.com/wwwroot/file/3") Then
Dim response As WebResponse = request.GetResponse()
End If
doesn't help me cause it threw error
The remote server returned an error: (550) File unavailable
...
Go to the complete details ...