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



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

"Eugene" wrote:

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
.



Relevant Pages

  • Re: libfetch ftp patch for less latency
    ... All ftp servers I've ever seen support a full path when changing down ... This might be a DOS ftp server thing however. ... If the pathname fails it only adds one more CWD, but reduces the time on the successful cases. ...
    (freebsd-current)
  • Ftp Server/Protocol Help
    ... I'm having an issue with an FTP server that i'm developing. ... explorer ftp client respond as it should. ... then it will CWD to the directory above and enter the ... find the rest of the files it does do a CWD to the folder above it, ...
    (microsoft.public.inetserver.iis.ftp)
  • online update and packman mirrors couldnt CWD to update
    ... Tried a few packman mirrors and always get the same message: ... CWD to update. ... Server name: ftp.cesnet.cz ... Can somebody propose a valid pathname, ftp or http in two separate ...
    (alt.os.linux.suse)
  • Simplifying anonymous FTP
    ... to automatically do a "cwd pub" when logging in (forced ... on the server side)? ... To unsubscribe: http://www.redhat.com/mailman/listinfo/fedora-list ...
    (Fedora)