FR Chalaoux wrote:
Hi,
I fixed the problem :
getPDB method ============= <dtml-var "getfiles(REQUEST, REPONSE)">
getfiles.py Extension file =========================== def getfiles(self, REQUEST['ids'], RESPONSE): PickleJar = Trinket('/me/foo-ids.gz','x/gzip') PickleJar.download(RESPONSE) blah, blah ...
But now , when I save the file the filename is getPDB (getPDB method is took in fact), not the name of my downloaded file.
Modify download like so: def download(self, RESPONSE): RESPONSE['Content-type']=self.type RESPONSE['Content-Disposition'] = 'attachment; filename=%s' % name_of_the_file); return open(self.path).read() You'll of course have to find a way to get the name of the file there instead of name_of_the_file, but I'm sure that's not too difficult :) -- Nick Garcia | ngarcia@codeit.com CodeIt Computing | http://codeit.com