ok so i have

@expose(content_type=CUSTOM_CONTENT_TYPE)
        def Download(self,file):
            username = request.identity['repoze.who.userid']
            dir_name = session.get('dir', None)
            filename = '/home/rubberduckiee/webapps/editor/Xinha/
plugins/ExtendedFileManager/files'+str(dir_name)+'/'+str(file)

            st = os.stat(filename)
            size = st[ST_SIZE]

            rh = response.headers
            rh['Pragma'] = 'public' # for IE
            rh['Expires'] = '0'
            rh['Cache-control'] = 'must-revalidate, post-check=0, pre-
check=0' #for IE
            rh['Cache-control'] = 'max-age=0' #for IE
            rh['Content-Type'] = 'image/jpg'
            disposition = 'attachment; filename="'+filename+'"'
            rh['Content-disposition'] = disposition
            rh['Content-Transfer-Encoding'] = 'binary'
            rh['Content-Length'] = size


a file downloads but the it fails to open because the file is empty.
What am i missing

Do i need to read the file to an output? if so how?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to