RE: Seaside Digest, Vol 50, Issue 46

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

RE: Seaside Digest, Vol 50, Issue 46

Eugene Westerhof

Hi ...
 
To make WaCachedDocument work for image-files in the seaside version that came with visualworks, I had to change SeasidePlatformSupport>>mimeDocumentOfType:from: as follows
 
mimeDocumentOfType: type from: aString 
 | mimeType aFilename |
 aFilename := aString asFilename.
 mimeType := type
    ifNil: [Net.MimeTypeDescriptor mimeTypeForFile: aFilename].
 mimeType isImageType
  ifTrue:
   [^self mimeDocumentClass contentType: mimeType
    content: (ImageReader fromFile: aFilename) image
      asGIFNonTransparent gifBytes].
 ^self mimeDocumentClass contentType: mimeType
  content: aFilename readStream upToEnd
 
where the method isImageType does the obvious. This did the trick for me. Maybe there are better solutions
 
regards,
Eugene


Zeg meteen wat je denkt met Windows Live Messenger! Windows Live Messenger!
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside