Ah, me. Another misbehaving FTP client program. Strange that the
developing company 'suggested' the use of the Microsoft FTP server...

Fun is had by all when we receive charmingly confused commands like
"STOR /uploads\ow123456.dat". While the client application can be
told what directory to store into, such as "/uploads", it always uses
a Windows path delimiter when appending the filename to that
path. And of course the application will be fixed "someday soon",
but we have to make it work "right now".

What I have running "right now" is as follows:

RewriteEngine on
# Define a map that uses the internal "replaceall" function
RewriteMap replace int:replaceall
# Try handling Windows-specific filepaths, converting any embedded
# backslash char path delimiters to forward-slash chars
RewriteCondition %m
"^(CWD|XCWD|MKD|XMKD|RMD|XRMD|APPE|STOR|RETR|LIST|N LST|RNFR|RNTO|SIZE|STAT|DELE|MDTM)$"
RewriteRule ^(.*) "${replace:!$1!\\!/}"

What this says is to replace every occurrence of the '\' character
with a '/' character in the command argument(s), if the command is
one of those mentioned in the RewriteCondition statements.

And it is working fine, where I can even say "CD \\temp\\" in the
command line client and we act as though "CD /temp/" had been
entered. But I wonder about a couple things...

First question is, will I run into any problems if the arguments
(filenames and paths) contain '!" characters? I haven't been able to
break it yet, but I worry.

Second question is, is it worth it for clarity to change to the form:

RewriteCondition %m "^CWD$" [OR]
RewriteCondition %m "^XCWD$" [OR]
RewriteCondition %m "^MKD$" [OR]
RewriteCondition %m "^XCWD$" [OR]
: : : :
RewriteCondition %m "^DELE$" [OR]
RewriteCondition %m "^MDTM$"
RewriteRule ^(.*) "${replace:!$1!\\!/}"

Third question, has anybody tried using mod_rewrite with some of the
extended/optional commands, such as "SITE CHMOD" ? It seems to very
badly not work, as though the code will always use the original argument texts.


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?p...rge&CID=DEVDEV
_______________________________________________
ProFTPD Users List
Unsubscribe problems?
http://www.proftpd.org/list-unsub.html