Changeset 5962


Ignore:
Timestamp:
04/11/09 09:29:56 (10 years ago)
Author:
domlowe
Message:

wcs was not deleting temporary files.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cows/trunk/cows/pylons/wcs_controller.py

    r5915 r5962  
    1111@author: Stephen Pascoe 
    1212""" 
    13  
    14 import re 
     13     
     14import re, os 
    1515import math 
    1616from cStringIO import StringIO 
     
    203203        response.headers['Content-Type']=mType 
    204204        response.headers['Content-Disposition'] = paste.httpheaders.CONTENT_DISPOSITION(attachment=True, filename=filepath) 
    205         return response.write(fileToReturn.read()) 
     205        u=fileToReturn.read() 
     206        #close and delete file from file system 
     207        fileToReturn.close() 
     208        log.debug('deleting temporary file %s'%filepath) 
     209        os.system('rm %s'%filepath) 
     210        return response.write(u) 
     211         
     212         
    206213             
    207214    def DescribeCoverage(self): 
Note: See TracChangeset for help on using the changeset viewer.