[Zope] Serving external files

Tony McDonald tony.mcdonald@ncl.ac.uk
Tue, 28 Mar 2000 10:19:56 +0100


At 10:09 am +0200 28/3/00, Allen Wallis wrote:
>Hi,
>I have some questions about serving external files:
>The zope id of the external method is "getFile".
>
>I have a dtml method that calls this external method, using
><dtml-var "getFile(REQUEST, RESPONSE)">
>The id of this dtml method is "download".
>Say I have a dtm document with something like
><a href="download">SomeFile.dat</a>
>
>This works, and the file is downloaded correctly. I want to know firstly
>whether there is a better way of achieving this.

Yes. Use the LocalFS product, it's taken care of a lot of the things 
that you're battling with (I've done the same thing and am in the 
process of moving to LocalFS).

>Secondly, when the user clicks on the SomeFile.dat hyperlink, and the
>browser's "save as" dialog pops up, the browser uses the id of the dtml
>method "download" as the filename in the dialog. Obviously I would
>rather this dialog shows the name of the file that will be downloaded.
>How can I change this? I can't rename the dtml method suitable for each
>different filname that might be downloaded, so where else can I alter
>this behaviour?

Again, LocalFS will do this for you (my main reason for switching!).

hth
tone
------
Dr Tony McDonald,  FMCC, Networked Learning Environments Project 
http://nle.ncl.ac.uk/
The Medical School, Newcastle University Tel: +44 191 222 5888
Fingerprint: 3450 876D FA41 B926 D3DD  F8C3 F2D0 C3B9 8B38 18A2