[BUG] Hugely inefficient FTP code: coding opportunity

Hannes Hirzel hirzel at spw.unizh.ch
Mon Feb 11 21:33:28 UTC 2002


On 11 Feb 2002, Cees de Groot wrote:

> OTOH, HTTP PUT in this context would be using it for precisely the
> thing it was designed for: publishing stuff to web servers. The format
> is extremely simple (PUT <pathname> HTTP/1.0, CRLF, Content-type:
> application/binary CRLF, Authorization: basic; usernamepasswordinbase64
> CRLF CRLF, data - from the back of my head, but that's basically the
> whole thing you need to send), and I have looked around and enabling it
> on the SqF modules server wouldn't be terribly hard so I'd be willing to put
> some time into it (Apache can do HTTP PUT out-of-the-box through mod_put, but
> for the SqF modules server I'd need a suid CGI script that switches to the
> authorized user and does some pathname checks so that modules would be
> uploaded to safe areas only and with the correct ownership information;
> however, if someone wants to take a stab at this your local Apache install
> will serve you quite allright).

This sounds interesting that the protocol is so simple. 

Could somebody give an example of this like the ftp example on the
'Hello World Programs' page on the Swiki

http://minnow.cc.gatech.edu/squeak/2230

s := ServerDirectory new.
s type: #ftp.
s server: 'myServerId'.
s user: 'myUserName'.
s password: 'myPassWord'.
s directory: '/theFullPathOfMyHomeDirectory'. 
s openFTP.
stream:=s fileNamed: 'helloWorld.txt'.
stream nextPutAll: 'hello world!'.
stream close.

s quit.


The task would be to give an analogous script for putting a file
'helloWorld.html' with the content
'<html><h1>Hello World</h1></html>'
on a web server. So  people could try it out if it's possible with the
web server they are working with or if this function is disabled.
Having such a script is a valuable asset in using Squeak as an web
authoring system.


Cheers 
Hannes Hirzel




More information about the Squeak-dev mailing list