source: WAeUP_SRP/trunk/skins/waeup_upload/download_errors.py @ 15804

Last change on this file since 15804 was 3326, checked in by Henrik Bettermann, 17 years ago

some beautifying

  • Property svn:keywords set to Id
File size: 968 bytes
Line 
1## Script (Python) "download_errors"
2##bind container=container
3##bind context=context
4##bind namespace=
5##bind script=script
6##bind subpath=traverse_subpath
7##parameters=
8##title=
9##
10# $Id: download_errors.py 3326 2008-03-12 22:28:34Z henrik $
11"""
12export xxx.errors
13"""
14try:
15    from Products.zdb import set_trace
16except:
17    def set_trace():
18        pass
19request = context.REQUEST
20setheader = request.RESPONSE.setHeader
21#set_trace()
22data = context.getContent()['getErrors']()
23filename = context.getId().replace('.csv','_errors.csv')
24#setheader('Content-type', 'text/x-cvs')
25#setheader('Content-type','application/vnd.ms-excel')
26setheader('Content-type','text/semicolon-seperated-values')
27setheader('Content-Disposition:', 'attachment; filename=%s' % filename)
28setheader('Expires',  'Mon, 26 Jul 1997 05:00:00GMT') # Date in the past
29setheader('Cache-Control', 'no-store, no-cache,must-revalidate') # HTTP/1.1
30setheader('Cache-Control', 'post-check=0,pre-check=0')
31#setheader('Pragma', 'no-cache') # HTTP/1.0
32return data
Note: See TracBrowser for help on using the repository browser.