[Seaside] File to URL

Nicolas Vanni seasidepharo at yahoo.fr
Mon Nov 29 17:25:02 UTC 2010


works perfectly :) :D :)

De : Nick Ager <nick.ager at gmail.com>
À : Seaside - general discussion <seaside at lists.squeakfoundation.org>
Envoyé le : Lun 29 novembre 2010, 17h 33min 23s
Objet : Re: Re : [Seaside] File to URL


The render methods are meant to generate html. 

>renderContentOn: html
>MyFileLibrary addAllFilesIn:  './'.
>MyFileLibrary addFileAt: 'test.pdf'.

These lines add the files all files in the local directory to the file library 
and specifically test.pdf *each* time the browser requests a page. Instead you 
only need to a file to the file library once. You can do this programmatically 
say via the workspace in the your image:

MyFileLibrary addFileAt: '<path to file>/test.pdf'.

or via the web ui, by browsing to /config then selecting files, MyFileLibrary
html image url: (MyFileLibrary urlOf: #testPdf).

You can then render a link to the file by:

renderContentOn: html
    html anchor url: (MyFileLibrary / #testPdf); with: 'click here to download 
my pdf'

WAExternalFileLibrary is another option....


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20101129/48eb390d/attachment.htm

More information about the seaside mailing list