[Seaside] Downloadable content

Bob Arning arning at charm.net
Sat Dec 18 17:17:41 UTC 2010


Here's an approach:

1. Create an external directory you want to share

2. Tell seaside where it is:
| mylib |
mylib := WAExternalFileLibrary new.
mylib preferenceAt: #directory put: '/downloadable'.    "<--- absolute 
path you your directory"
mylib preferenceAt: #listing put: true.
WADispatcher default register: mylib at: 'mystuff'

3. Put a link that point to the file you want the user to download:
     html anchor
         url: '/mystuff/filenumber1';
         type: ( WAMimeType new main: 'text'; sub: 'csv');
         with: 'text for anchor'.

4. Or a link that let's them download any file in the directory:
     html anchor
         url: '/mystuff/';
         with: 'text for anchor'.

Cheers,
Bob

On 12/18/10 10:46 AM, alexandre bp wrote:
> Thank you for you reply.
> yes but the problem is that I don't understand how to give the file to 
> the client from the file library....
> It must be very stupid but I have never done it  (even in PHP)  so I 
> have no clue...
> cheers
> alex
>
> 2010/12/17 Sean Allen <sean at monkeysnatchbanana.com 
> <mailto:sean at monkeysnatchbanana.com>>
>
>     You can put downloadable content in a file library or serve
>     directly from the file system via the webserver w/o going through
>     Seaside.
>
>     On Fri, Dec 17, 2010 at 12:10 PM, alexandre bp <abalonpe at ulb.ac.be
>     <mailto:abalonpe at ulb.ac.be>> wrote:
>
>         Hi,
>
>         I'd like to add a downloadable content on my website and I
>         don't have any idea how to do that.
>         I saw the fileUpload method in the WARenderCanvas to upload a
>         file on the server but I don't find anything to download a
>         file from it...
>         Where should I put the downloadable file and how to export it
>         to the computer of the client?
>
>         Thx in advance,
>
>         alex
>
>         _______________________________________________
>         seaside mailing list
>         seaside at lists.squeakfoundation.org
>         <mailto:seaside at lists.squeakfoundation.org>
>         http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
>
>
>     _______________________________________________
>     seaside mailing list
>     seaside at lists.squeakfoundation.org
>     <mailto:seaside at lists.squeakfoundation.org>
>     http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
>
>
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20101218/9a692da8/attachment.htm


More information about the seaside mailing list