0

Is it possible to delete non empty folder in web? I cant delete it using this code as long as its non empty folder.
I can delete files under the folder but folder may consist sub folders too. Whats is the simple way to do this?

  Dim clsRequest As System.Net.FtpWebRequest = _
DirectCast(System.Net.WebRequest.Create("ftp://ftp.server.com/folder), System.Net.FtpWebRequest)

                        clsRequest.Credentials = New System.Net.NetworkCredential(TextBox2.Text, TextBox3.Text)
                        '                      

                        clsRequest.Method = System.Net.WebRequestMethods.Ftp.RemoveDirectory


                        Dim response As FtpWebResponse = CType(clsRequest.GetResponse, FtpWebResponse)
                        response.Close()

Edited by ulasoc

2
Contributors
1
Reply
2
Views
4 Years
Discussion Span
Last Post by Nutster
0

WebRequestMethods.Ftp is a wrapper for a client of the FTP Internet service. Some FTP Servers support multiple file deletion with the MDEL command, but some don't. It is possible with the mdelete client command to nuke a populated directory, but only if the server allows it. Unfortunately, mdelete is not one of the commands supported by the FTP class.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.