Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / October 2007

Tip: Looking for answers? Try searching our database.

FtpWebRequest doing a CWD in addition to PWD, with extra "/"

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Eugene - 15 Oct 2007 23:57 GMT
Hi,
I am not sure if anyone has encountered the same problem and know the
answer...

When I set an FtpWebRequest to do PWD with the following code,
_FtpWebRequest.Method = WebRequestMethods.Ftp.PrintWorkingDirectory;
_FtpWebResponse = (FtpWebResponse)_FtpWebRequest.GetResponse();

the trace showed that FtpWebRequest also does a CWD, as shown in the
following trace:

System.Net Information: 0 : [3756] FtpControlStream#33163964 - Sending
command [PWD]

System.Net Information: 0 : [3756] FtpControlStream#33163964 - Received
response [257 "*.*/*" is the current directory]

System.Net Information: 0 : [3756] FtpControlStream#33163964 - Sending
command [CWD *.*/*/]

System.Net Information: 0 : [3756] FtpControlStream#33163964 - Received
response [550 Invalid directory.]

As you can see from the last two lines of trace, the framework performs an
CWD with and extra "/" which makes the server throw a 550 error.

Another related issue is that the framework seems to treat "*.*/*" in the
above example as the root directory so when I specify a remote directory,
FtpWebRequest fwr =
(FtpWebRequest)WebRequest.Create("ftp://usa.ftptls.edisrvcs.com/GXS.U9999443");
where "GXS.U9999443" is the directory, the trace showed that .NET try to
change to the directory under "*.*/*" with a "CWD *.*/*/gxs.u9999443" ,
instead of just simply change to that directory with the command "CWD
gxs.u9999443" thus an error occurs:

System.Net Information: 0 : [4352] FtpControlStream#2637164 - Received
response [257 "*.*/*" is the current directory]
System.Net Information: 0 : [4352] FtpControlStream#2637164 - Sending
command [CWD *.*/*/GXS.U9999443]

Has anyone encountered the same issue and how did you resolve it?

Thanks!!!

Eugene
Eugene - 19 Oct 2007 18:12 GMT
By modifying the URI to ftp://usa.ftptls.edisrvcs.com//GXS.U9999443 (note the
extra slash between the server address and the remote directory) I was able
to avoid the problem of .NET CWD into *.*/*/gxs.u9999443.  However, .NET is
still adding an extra slash in front, performing a CWD /EGXS.U9999443 and the
server is still throwing me a [550 Invalid directory.].  

Does anyone know how I can get .NET to do nothing but a simple
[CWD EGXS.U9999443]?

Thanks,

Eugene

> Hi,
> I am not sure if anyone has encountered the same problem and know the
[quoted text clipped - 41 lines]
>
> Eugene

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.