[Seaside] Images in a CSS style library

Pavel Krivanek squeak3 at continentalbrno.cz
Fri Apr 22 13:31:33 CEST 2005


> Thanks.
> It does not yet work for me, though. The HttpResponse is answered
correctly,
> but in the browser the images are not displayed.
> How have you stored your images? I have stored png-images as a byte array
in
> the image. Then the HttpResponse answers this byte array as a read stream,
> so this should be okay, i guess?
> But when I write 'html imageWithDocument: myImg mimeType: 'image/png'
> fileName: nil' in a component, then the image is displayed, so I think it
> should be stored correctly.

U use this implementation:

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.






More information about the Seaside mailing list