Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
3.3k views
in .NET FTP by (380 points)
I am currently working with the edtFTPnet (Free Version). When I run the code below I get and access denied error on the specified folder. I have granted full permission to that folder and I am an administrator to my computer. Is their something that I am missing or need to change?

Private Sub Connect_MC_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Connect_MC.Click
FtpConnection1.ServerAddress = (Server_Info.Text)
FtpConnection1.UserName = (MC_UN_1.Text)
FtpConnection1.Password = (MC_P_1.Text)
FtpConnection1.Connect()
FtpConnection1.ChangeWorkingDirectory("/var/tmp")
Dim file_1 As String = "serverinfo" & ".txt"
FtpConnection1.DownloadFile("C:\logs", file_1)
FtpConnection1.Close()
End Sub
:(

4 Answers

0 votes
by (162k points)
I doubt that the FTP server permits users to navigate to /var/tmp.
0 votes
by (380 points)
The directory is not the problem. The error only occurs when it tires to access the folder. I have also been reading a few posts and found that If it change the code to the one below, it will download the file but still will not put it in the folder that I specify. If only puts it on the root of the C:.

Public Class Form1
Private Sub Connect_MC_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Connect_MC.Click
FtpConnection1.ServerAddress = (Server_Info.Text)
FtpConnection1.UserName = (MC_UN_1.Text)
FtpConnection1.Password = (MC_P_1.Text)
FtpConnection1.Connect()
FtpConnection1.ChangeWorkingDirectory("/var/tmp")
FtpConnection1.ChangeWorkingDirectory("/var/tmp")
Dim file_1 As String = "serverinfo" & ".txt"
FtpConnection1.DownloadFile("C:\logs" + file_1, file_1)
FtpConnection1.Close()
End Sub

Does any one know how to correct this or what I am doing wrong?
0 votes
by (162k points)
I don't think your path is correct.

"C:\logs" + file_1 is probably invalid

try "C:\logs\" + file_1 or something like that
0 votes
by (380 points)
Thank you, that did it.

Categories

...