[Seaside] unable to display image from local directory

jtuchel at objektfabrik.de jtuchel at objektfabrik.de
Sun Jan 25 15:48:25 UTC 2015


Sanjay,

Pharo doesn't serve files from the local file system by default. There 
are specialised subclasses of WAFileLibrary (or at least you could build 
one) to do that. What you do is send an img tag down to the browser that 
contains a src="myimage.gif" attribute. The browser then has to fetch 
this image from the web server, in your case the Pharo image and Seaside...

There are several options:

1) as I mentioned before, add a FileLibrary to your application that can 
serve local files (you'd have to send urlOf: to the FileLibrary class to 
send the correct src attribute)
2) use an url of a web server that server files, like html image url: 
'Mydropbox.com/myimage.gif'
3) Import your image into a WAFileLibrary subclass so that it has a 
method that holds a ByteArray of the contents of this image. Then you 
can server the image from within Pharo

HTH,

Joachim



Am 25.01.15 um 16:37 schrieb Sanjay Minni:
> Hi
>
> I am unable to display an image from a local directory using
>
>      html image url: 'myimage.gif'
>      (where myimage.gif is stored in the same directory as the pharo image),
>
> but it works fine if I point to the image with  complete URL on the new say
>      html image url: 'http://www.mysite.com/myimage.gif'
>
> so how can I pick up from the local directory
>
> regards
> Sanjay
>   
>
>
>
> -----
> ---
> Regards, Sanjay
> --
> View this message in context: http://forum.world.st/unable-to-display-image-from-local-directory-tp4801549.html
> Sent from the Seaside General mailing list archive at Nabble.com.
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>


-- 
-----------------------------------------------------------------------
Objektfabrik Joachim Tuchel          mailto:jtuchel at objektfabrik.de
Fliederweg 1                         http://www.objektfabrik.de
D-71640 Ludwigsburg                  http://joachimtuchel.wordpress.com
Telefon: +49 7141 56 10 86 0         Fax: +49 7141 56 10 86 1



More information about the seaside mailing list