Re: PUT and FTP?

--
--PART-BOUNDARY=.19604261258.ZM13761.lotus
Content-Type: text/plain; charset=us-ascii

Blake,


On Apr 26,  2:29pm, Blake Sobiloff wrote:
> >I want this in case the Web server the user is connected to
> >doesn't support HTTP PUT (as the two most popular servers currently,
> >NCSA and Apache, don't).
>
> Huh? I've been using HTTP PUT with my SunOS copy of HTTPd v1.5 without
> problem. Of course you have to have a CGI script write the data out to
> disk, but that's not a big deal.

Are you referring to NCSA?  I'm guessing from the "v1.5".  Other
servers also call their executable "httpd", so it's confusing.

OK, so apparently NCSA works.  I didn't know.  It's certainly
not documented.  NCSA's response to the recent WebCompare survey
(http://www.webcompare.com) indicated that they didn't.  Both they
and Apache indicated support for it in the future.  Yes, I noticed code
for PUT in their code, but given the above, I assumed it was a
prototype, and didn't really work.  I'm glad to hear it does.

The only server I could find any documentation on doing PUT
for was the old CERN server at www.w3.org.  These instructions
for a "writable server" are available at http://symposia.inria.fr/
symposia/userdoc/put. I did get this to work.  I have attached
the CGI shell script from these instructions.  Does your CGI
script look much different?



--PART-BOUNDARY=.19604261258.ZM13761.lotus
X-Zm-Content-Name: putscript.sh
Content-Description: Put script
Content-Type: text/plain ; name="putscript.sh" ; charset=us-ascii

#!/bin/ksh
#
#	Script to handle PUT
#

SYS=`uname`
CGIPARSE=$CGIPARSE

# $PATH_TRANSLATED contains the absolute path of the file being accessed

LOGFILE=/lotus/pkg/src/web/CERN/server_root/logs/put.log
> $LOGFILE
/bin/date >> $LOGFILE
/usr/bin/id >> $LOGFILE
echo "***************************" >> $LOGFILE
echo "
SERVER_SOFTWARE=$SERVER_SOFTWARE
SERVER_NAME=$SERVER_NAME
GATEWAY_INTERFACE=$GATEWAY_INTERFACE
SERVER_PROTOCOL=$SERVER_PROTOCOL
SERVER_PORT=$SERVER_PORT
REQUEST_METHOD=$REQUEST_METHOD
HTTP_ACCEPT=$HTTP_ACCEPT
PATH_INFO=$PATH_INFO
PATH_TRANSLATED=$PATH_TRANSLATED
SCRIPT_NAME=$SCRIPT_NAME
QUERY_STRING=$QUERY_STRING
REMOTE_HOST=$REMOTE_HOST
REMOTE_ADDR=$REMOTE_ADDR
AUTH_TYPE=$AUTH_TYPE
REMOTE_USER=$REMOTE_USER
REMOTE_IDENT=$REMOTE_IDENT
CONTENT_TYPE=$CONTENT_TYPE
CONTENT_LENGTH=$CONTENT_LENGTH
LOG_FILE=$LOG_FILE/tmp/your.gen.log
" >> $LOGFILE
echo "***************************" >> $LOGFILE

# Answering ...
cat<<_EOT_
Content-Type: text/html

<!DOCTYPE HTML SYSTEM "HTML.dcl" [
<!NOTATION GrifImg SYSTEM "GrifImg">
<!NOTATION GrifIDoc SYSTEM "GrifIncludeDoc">
]>
<HTML>
<?GrifModel "htmlp">
<HEAD>
<TITLE>PUT script reply</TITLE>
</HEAD>
<BODY>
<P>
_EOT_

# Arhiving ...
mv -f $PATH_TRANSLATED.4 $PATH_TRANSLATED.5 2>/dev/null
mv -f $PATH_TRANSLATED.3 $PATH_TRANSLATED.4 2>/dev/null
mv -f $PATH_TRANSLATED.2 $PATH_TRANSLATED.3 2>/dev/null
mv -f $PATH_TRANSLATED.1 $PATH_TRANSLATED.2 2>/dev/null
cp    $PATH_TRANSLATED   $PATH_TRANSLATED.1

# Writing ...
$CGIPARSE -read > $PATH_TRANSLATED

# Answering ...
cat<<_EOT_
<B>
Ok, document stored successfully.
</B>
</BODY>
</HTML>

_EOT_

--PART-BOUNDARY=.19604261258.ZM13761.lotus--

Received on Friday, 26 April 1996 15:54:11 UTC