Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
2.4k views
in .NET FTP by (160 points)
Here is my code, I would like to get all the files under to local destination.
And I keep getting this error message "UnauthorizedAccessException: Access to the path 'c:\inetpub\wwwroot\IVRS_XML\Download' is denied. at "
Any suggestion will help..... :?

Public Function FtpDownload() As String
Dim localPath
Try
localPath = Server.MapPath("/") & ("\IVRS_XML\Download")
Dim ftp = New FTPClient()
ftp.RemoteHost = "ftp.******com"
ftp.Connect()
ftp.Login("******", "******")
ftp.ConnectMode = FTPConnectMode.ACTIVE
ftp.TransferType = FTPTransferType.BINARY
ftp.ChDir("/users/******/******/")
ftp.Get(localPath, "*.xml")
ftp.Quit()
Catch ex As Exception
Return (ex.ToString())
End Try
Return "download sucessfull"
End Function

1 Answer

0 votes
by (162k points)
The Get method is for a single file.

You will need to use DirDetails to get a list of files in the directory and fetch one by one.

Or else consider our edtFTPnet/Express product which has numerous methods for fetching directories.

http://www.enterprisedt.com/products/ed ... rview.html

Here is my code, I would like to get all the files under to local destination.
And I keep getting this error message "UnauthorizedAccessException: Access to the path 'c:\inetpub\wwwroot\IVRS_XML\Download' is denied. at "

Categories

...