[Seaside] serve jpg image files from form objects

Philippe Marschall philippe.marschall at gmail.com
Wed May 31 20:37:51 UTC 2006


If you want to do this with FileLibrary
- Load the latest FileLibrary from the Seaside repository at SqueakSource
- go to your /seaside/config application and make sure there's an
application of the type "Static File Library" named files (should
happen automatically if you load FileLibrary-pmm.8 and had no previous
version loaded)
- create a subclass of WAFileLibrary named let's say MyFileLibrary
- configure the files application, again in the  /seaside/config application
- add MyFileLibrary and configure it too
- add/upload your 'wave.jpg' file (might take a moment)
- in your seaside application you can use the following code

html image: '/files/wave.jpg'

You can check in MyFileLibrary into Monticello, file it out, make a
changeset, .... it will take 'wave.jpg' everywhere it goes.


2006/5/31, Martin Schubert <martin.schubert at informatik.uni-ulm.de>:
> hello out there,
> allthough i browsed throught the archives i couldn`t find the answer
> to my problem.
> i want to serve a jpg-file which is stored in a Form object.
> so i do : aForm _ (Form fromFileNamed: 'wave.jpg')
> then i tried the following inside the #renderContentOn:  method :
> html imageWithDocument: aForm bits asByteArray
>                 mimeType: 'image/jpeg'
>                 fileName: root name,'Picture', '.jpg'.
> this doesn`t work, and when i am acceptin the following, seaside
> seems to convert the jpg file to gif or wracks up the picture file
> somehow :
>         html imageWithDocument: aForm
>                 mimeType: 'image/jpeg'
>                 fileName: root name,'Picture', '.jpg'.
> anybodys having some experience with this issue?
> thanks for help!
> martin
> _______________________________________________
> Seaside mailing list
> Seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

More information about the Seaside mailing list