<DIV>I did the following.</DIV> <DIV> </DIV> <DIV>Firstly I initialized the gifs. I could do this because my gifs are fixed, I don´t need dynamic files:</DIV> <DIV> </DIV> <DIV>SomeClass>>intializeGifs<BR> |gifs imagekey newGif|<BR> gifs:= (FileDirectory on: 'C:\SES\product\squeak 3.8\working\img') fileNamesMatching: '*.gif'.<BR> gifs do: [:gif |<BR> imagekey:= ('DES-',(gif copyUpTo: $.)) asSymbol.<BR> newGif:= (FileStream readOnlyFileNamed: 'C:\SES\product\squeak 3.8\working\img\' , gif) reset; binary; contents.</DIV> <DIV> ScriptingSystem formDictionary at: imagekey put: (newGif)].<BR> </DIV> <DIV>where 'C:\SES\product\squeak 3.8\working\img' is a path in the server context.</DIV> <DIV> </DIV> <DIV>Then to use them:</DIV> <DIV> </DIV> <DIV>MyWAHtmlRenderer>>getImage: anImageName withPath: aPath<BR> |imagekey newForm|<BR> imagekey:= ('DES-',(anImageName
copyUpTo: $.)) asSymbol.<BR> (ScriptingSystem formAtKey: imagekey) isNil<BR> ifTrue: [newForm:= (FileStream readOnlyFileNamed: ((FileDirectory default pathName),'\', aPath,'\',anImageName)) reset; binary; contents.<BR> ScriptingSystem formDictionary at: imagekey put: (newForm).<BR> ].<BR> <BR> ^self imageWithForm: (ScriptingSystem formAtKey: imagekey).</DIV> <DIV><BR> </DIV> <DIV>and also override...</DIV> <DIV> </DIV> <div>MyWAHtmlRenderer>>imageWithForm: aForm<BR> self image: (self context urlForDocument: aForm)</div> <div> </div> <div>and defined:</div> <div> </div> <div>ByteArray>>asMIMEDocument <BR> ^MIMEDocument contentType: 'image/gif' content: self </div> <DIV><BR>Felipe<BR><BR><B><I>Jens Pall <jens@axonspace.com></I></B> escribió:</DIV> <BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px
solid">Bany, Michel wrote:<BR>> <BR>>> Regarding the files, I am looking for a way to serve binary <BR>>> data from directly within the image itself, not using files <BR>>> on the external filesystem. I'm planning on using Magma as <BR>>> the persistent repository for everything and don't want to <BR>>> rely on stuff out on the filesystem, hence I need a way to <BR>>> load and serve my images completely from within squeak.<BR>> <BR>> You may want something like this<BR>> <BR>> (html anchor)<BR>> document: aByteArray <BR>> mimeType: 'application/msword' <BR>> fileName: 'report.doc'<BR>> <BR><BR>Yes, this looks promising.<BR><BR>But how do I load the document from disk into aByteArray? I think I can <BR>do this using a web form, but I want to be able to load it directly from <BR>the filesystem (used in a batch load later).<BR><BR>JP<BR>_______________________________________________<BR>Seaside mailing
list<BR>Seaside@lists.squeakfoundation.org<BR>http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside<BR></BLOCKQUOTE><BR>