[Seaside] Downloadable content
bobn at rogers.com
Sat Dec 18 17:07:27 UTC 2010
Here's some old code that I've been using. There may be a more current
In the 'download file' callback method...
byteArray := [path asFilename contentsOfEntireBinaryFile]
do: [:ex | ex description].
byteArray isString ifTrue: [^self parent prompt: byteArray title: 'Error
reading: ', path asString].
mimeType: (WAFileLibrary mimetypeFor: self fileSuffix)
(my session class)>>downloadBinary: aContents mimeType: aMimeType filename:
self requestContext respond: [:response |
headerAt: 'Content-length' put: aContents size printString;
On Sat, Dec 18, 2010 at 10:46 AM, alexandre bp <abalonpe at ulb.ac.be> 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...
> 2010/12/17 Sean Allen <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>wrote:
>>> 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,
>>> seaside mailing list
>>> seaside at lists.squeakfoundation.org
>> seaside mailing list
>> seaside at lists.squeakfoundation.org
> seaside mailing list
> seaside at lists.squeakfoundation.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the seaside