Changeset 5827 for cowsclient


Ignore:
Timestamp:
09/10/09 15:24:04 (10 years ago)
Author:
pnorton
Message:

Changed the download action to pickup the 'Content-Type' and 'Content-Disposition' form the response of the wcs server.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cowsclient/trunk/cowsclient/controllers/wcsdown.py

    r5821 r5827  
    146146        log.debug("output = %s" % (output,)) 
    147147         
    148         mType='application/cf-netcdf' 
    149         response.headers['Content-Type']=mType 
    150         response.headers['Content-Disposition'] = paste.httpheaders.CONTENT_DISPOSITION(attachment=True, filename='download.nc') 
     148        log.debug("output.headers.keys() = %s" % (output.headers.keys(),)) 
     149        log.debug("output.geturl() = %s" % (output.geturl(),)) 
     150         
     151        response.headers['Content-Type']=output.headers['Content-Type'] 
     152         
     153        if 'Content-Disposition' in output.headers.keys(): 
     154            log.debug("output.headers['Content-Disposition'] = %s" % (output.headers['Content-Disposition'],)) 
     155            response.headers['Content-Disposition'] = output.headers['Content-Disposition'] 
     156        else: 
     157            response.headers['Content-Disposition'] = paste.httpheaders.CONTENT_DISPOSITION(attachment=True, filename='download') 
     158             
    151159        return output.read() 
    152160         
Note: See TracChangeset for help on using the changeset viewer.