Forum Index \ DriveHQ Customer Support Forum \
Read/Reply : 35527/2
  • amirak
  • (1 posts)

Hi,

Im using .net framework for making connections with DriveHQ. When I use Net.WebRequestMethods.Ftp.ListDirectory it just returns file names and NO FOLDER appears.

What's wrong?


7/14/2010 12:59:06 AM

  • DriveHQ Webmaster
  • (1098 posts)
Subject: Re: Net.WebRequestMethods.Ftp.ListDirectory

Sorry we usually cannot provide support to detailed development questions. You need to debug the detailed FTP commands that are sent and the responses received. You can compare it with other FTP client software. Most GUI-based FTP client software can display the detailed FTP log info.

For C# user, we have tested a sample program and it works fine:

-----------------------------------

 

 

static void Main(string

[] args)

{

 

 

FtpWebRequest request = (FtpWebRequest)WebRequest.Create("ftp://ftp.drivehq.com"

);

request.Method =

 

WebRequestMethods.Ftp

.ListDirectoryDetails;

 

 

// change it to your real username / password;.

request.Credentials =

 

new NetworkCredential ("USERNAME","PASWORD"

);

 

 

FtpWebResponse response = (FtpWebResponse

)request.GetResponse();

 

 

 

Stream

responseStream = response.GetResponseStream();

 

 

StreamReader reader = new StreamReader

(responseStream);

 

 

Console

.WriteLine(reader.ReadToEnd());

 

 

Console.WriteLine("Directory List Complete, status {0}"

, response.StatusDescription);

 

reader.Close();

response.Close();

}

 ---------------

It returns both file names and folder names.

Please note we cannot provide technical support on how to develop software; however, if you believe / fine our FTP server bugs, please contact us with more detailed info and we will fix the problem asap.

 

 

 

 

 

 

 

 

 

 


Reply
7/16/2010 1:03:10 PM

  • zyzy
  • (1 posts)
Subject: Re:Net.WebRequestMethods.Ftp.ListDirectory

If I use the exact code as above, it is fine. If I change ListDirectoryDetails to ListDirectory, then I would get the following error.

The remote server returned an error: (550) File unavailable (e.g., file not found, no access)

Is ListDirectory not supported ? I have both files and folders in my directory.....


Reply
1/5/2011 6:47:00 PM

Quickly Reply

Please logon and reply, Not DriveHQ Member?


Leading Cloud Surveillance service

Leading Enterprise Cloud IT Service Since 2003