[Seaside] Images in a CSS style library

Pavel Krivanek squeak3 at continentalbrno.cz
Thu Apr 28 17:17:39 CEST 2005


I use KomHttpServer 7.0.2 from SqueakMap

Can you store it as a string?
String withAll: ((FileStream readOnlyFileNamed: 'file.bin') binary
contentsOfEntireFile)

-- Pavel

----- Original Message ----- 
From: "David Röthlisberger" <davidroe at bluewin.ch>
To: "'The Squeak Enterprise Aubergines Server - general discussion.'"
<seaside at lists.squeakfoundation.org>
Sent: Thursday, April 28, 2005 2:18 PM
Subject: AW: [Seaside] Images in a CSS style library


> Hello,
>
> > loadStaticDocuments
> >
> >     Smalltalk at: #StaticDocumentsRepository put: Dictionary new.
> >
> >     (FileDirectory on: (FileDirectory default fullPathFor:
> > 'resources')) fileNames
> >         do: [ :fileName | self loadStaticDocument: fileName ].
> >
> >
> > loadStaticDocument: fileName
> >
> >      | path |
> >     path := (FileDirectory default fullPathFor: 'resources'),
> >  FileDirectory slash,  fileName.
> >
> >     StaticDocumentsRepository at: fileName
> >         put: (FileStream readOnlyFileNamed: path) binary
> > contentsOfEntireFile.
>
> Thanks.
>
> Basically I do the same as you and pass a byte array to the HttpResponse:
> (HttpResponse fromStream: img readStream contentType: 'image/png').
> img is a ByteArray with the data of the image.
>
> But I get an error when I try to access such an image in the browser:
> Strings only store characters.
> I use KomHttpServer 6.2 which uses SocketStreams. Now HttpAdaptor tries to
> store this ByteArray into the writeStream of the SocketStream, but this
> write stream is created with a String as the collection, so a ByteArray
> cannot be stored in this SocketStream. Too bad...
> Do you use another version of KomHttpServer? I tried 6.1 too, but this
does
> not work in a Squeak 3.7 image, i guess...
>
>
> David
>
>
>
> _______________________________________________
> Seaside mailing list
> Seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/listinfo/seaside
>



More information about the Seaside mailing list