[Seaside] Serving static graphics with comanche

goran at krampe.se goran at krampe.se
Tue Jan 3 11:15:46 CET 2006


=?ISO-8859-1?Q?C=E9drick_B=E9ler?= <cbeler at enit.fr> wrote:
> > I want comanche to serve static files and seaside application. The 
> > latter is ok and static files is also ok  as long as it is html... but 
> > I cannot view for instance an image file (.jpg  .bmp ...)... the 
> > processor hangs (os: linux). Is it normal ? is it due to what's said 
> > in this post ?

"processor hangs"? What Squeak and version of KomHttpServer do you use?

> oups I missed a post that gave this adress: 
> http://coweb.cc.gatech.edu/cs2340/2913 . Sorry !
> "Don't assume it knows where your data files are stored, because it 
> doesn't, plus that would be of no help anyway ****since it can't 
> directly display an image sitting in your squeak directory.****"
> ...
> form := Form fromFileNamed: 'squeaken.gif'
> ...
> (request url asLowercase endsWith: '.gif')
>     ifTrue: [^form].
> ...
> Do we need to do something like that to serve files ? 

No. :) Right now I don't have time testing your issue - but this code I
just verified in a 3.8 image with latest KomHttpServer (on win32):

| ma |
ma := ModuleAssembly core.
ma serverRoot: FileDirectory default fullName.
ma documentRoot: FileDirectory default fullName.
ma directoryIndex: 'index.html index.htm'.
ma serveFiles.
(HttpService startOn: 8080 named: 'httpd') plug: ma rootModule

It serves gif-files just fine.

> anyway I'll spend some time to dig into KomHttp...
> If someone knows a tutorial on that, please tell me

Tutorials for KomHttpServer... can't really say that I know of any.

But to play a bit with KomHttp I recommend installing HttpView2 on top
of it and playing with the examples - read the class comments. HttpView2
is a lightweight layer on top of KomHttpServer.

regards, Göran

More information about the Seaside mailing list