Changeset 49370

Show
Ignore:
Timestamp:
10/05/06 16:09:47 (3 years ago)
Author:
ogrisel
Message:

made the createFile (ZIP uploader) more robust to files with buggy suffixes

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • CPS3/products/CPSDocument/trunk/CHANGES

    r49296 r49370  
    77Bug fixes 
    88~~~~~~~~~ 
    9 - 
     9- made the createFile (ZIP uploader) more robust to files with buggy suffixes 
    1010New internal features 
    1111~~~~~~~~~~~~~~~~~~~~~ 
  • CPS3/products/CPSDocument/trunk/createFile.py

    r46766 r49370  
    7575        # Acquiring only the filename (without the directory path) 
    7676        path_filename = generateFileName(path.split('/')[-1]) 
    77         mimetype = registry.lookupExtension(path_filename.lower()).normalized() 
     77 
     78        mimetype = registry.lookupExtension(path_filename.lower()) 
     79        if mimetype is not None: 
     80            mimetype = mimetype.normalized() 
     81        else: 
     82            mimetype = 'application/octet-stream' 
     83 
    7884        if mimetype.startswith('image/'): 
    7985            ptype = 'Image'