Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
19.5k views
in General by (400 points)
Hi, does anyone had a problem like this?

System.UnauthorizedAccessException: Access to the path "d:\ftp" is
denied.

I'm getting anoying with this!
Below there's the code i'm using.
---------
Dim ftp As New FTPClient("ftp.xxx.com")
ftp.Login("user", "passwd")
ftp.ConnectMode = FTPConnectMode.ACTIVE
ftp.TransferType = FTPTransferType.BINARY
ftp.Get("d:\ftp", "gzip.exe")
ftp.Quit()

12 Answers

0 votes
by (162k points)
Typically, you can't cd to d:\ftp when logged in to an FTP server. It puts you in a virtual directory tree. You'll have to find out where the file you want is, within that virtual directory

Hi, does anyone had a problem like this?

System.UnauthorizedAccessException: Access to the path "d:\ftp" is
denied.

I'm getting anoying with this!
Below there's the code i'm using.
---------
Dim ftp As New FTPClient("ftp.xxx.com")
ftp.Login("user", "passwd")
ftp.ConnectMode = FTPConnectMode.ACTIVE
ftp.TransferType = FTPTransferType.BINARY
ftp.Get("d:\ftp", "gzip.exe")
ftp.Quit()
0 votes
by (400 points)
Well, but i do can cd to "d:\ftp", any idea?



Typically, you can't cd to d:\ftp when logged in to an FTP server. It puts you in a virtual directory tree. You'll have to find out where the file you want is, within that virtual directory

Hi, does anyone had a problem like this?

System.UnauthorizedAccessException: Access to the path "d:\ftp" is
denied.

I'm getting anoying with this!
Below there's the code i'm using.
---------
Dim ftp As New FTPClient("ftp.xxx.com")
ftp.Login("user", "passwd")
ftp.ConnectMode = FTPConnectMode.ACTIVE
ftp.TransferType = FTPTransferType.BINARY
ftp.Get("d:\ftp", "gzip.exe")
ftp.Quit()
0 votes
by (162k points)
??

Well, but i do can cd to "d:\ftp", any idea?
0 votes
by (400 points)
What do you mean by, "you do not have access to d:\ftp"

I do access to that folder
0 votes
by (400 points)
sorry again, when you said:

'Typically, you can't cd to d:\ftp when logged in to an FTP server. It puts you in a virtual directory tree. You'll have to find out where the file you want is, within that virtual directory'

Do you reffer to a local virtual directory ? For example, if i'm in "d:\", i mean, i'm executing my vb.net binary from that directory, and i'm going to access the ftp server from there, what should be the virtual directory??

i think i didn't understood it...
0 votes
by (162k points)
Typically, an FTP server's virtual directory for you the logged in FTP user has a single root, "/", and subdirectories off that root directory.

FTP servers often don't recognise drive letters. If this is the case for you, you will need to map D: to a subdirectory of "/" - this will require configuring the FTP server or finding out what the mappings are.
0 votes
by (400 points)
Sorry, i think you're are not understanding,

Dim ftp As New FTPClient("ftp.xxx.com")
ftp.Login("user", "passwd")
ftp.ConnectMode = FTPConnectMode.ACTIVE
ftp.TransferType = FTPTransferType.BINARY
ftp.Get("d:\ftp", "gzip.exe")
ftp.Quit()

the code below indicates that i'm getting the file "gzip.exe" from the ftp server and putting it to the local directory "d:\ftp"
like you're saying some servers don't support drive letters, ok, but i also tried to get the file like
ftp.Get(".", "gzip.exe")

that show that im putting the file that im retriving to the current directory, and i also got an "access denied"
0 votes
by (162k points)
Oh,sorry, try

ftp.Get("d:\ftp\gzip.exe", "gzip.exe");

you need to supply the filename

Sorry, i think you're are not understanding,

Dim ftp As New FTPClient("ftp.xxx.com")
ftp.Login("user", "passwd")
ftp.ConnectMode = FTPConnectMode.ACTIVE
ftp.TransferType = FTPTransferType.BINARY
ftp.Get("d:\ftp", "gzip.exe")
ftp.Quit()

the code below indicates that i'm getting the file "gzip.exe" from the ftp server and putting it to the local directory "d:\ftp"
like you're saying some servers don't support drive letters, ok, but i also tried to get the file like
ftp.Get(".", "gzip.exe")

that show that im putting the file that im retriving to the current directory, and i also got an "access denied"
0 votes
by (400 points)
ah, that better, i didn't try it but'm gonna try and let you know the results
0 votes
by (400 points)
Ok, it works, thanks :)

Categories

...