keep extension for application/octet-stream
git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@3168 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
		
							parent
							
								
									362eab61a5
								
							
						
					
					
						commit
						841e3d1e63
					
				
					 1 changed files with 11 additions and 5 deletions
				
			
		|  | @ -88,11 +88,17 @@ class ItemView(BaseView): | ||||||
|         baseUrl = urlInfo.baseUrl |         baseUrl = urlInfo.baseUrl | ||||||
|         while 'bscw.cgi' in baseUrl and not baseUrl.endswith('bscw.cgi'): |         while 'bscw.cgi' in baseUrl and not baseUrl.endswith('bscw.cgi'): | ||||||
|             baseUrl, ignore = baseUrl.rsplit('/', 1) |             baseUrl, ignore = baseUrl.rsplit('/', 1) | ||||||
|         extensions = '.' + (mimeTypes.get(self.context.contentType) or ['bin']) |         if (self.context.contentType == 'application/octet-stream' and | ||||||
|         extension = extensions[0] |                 len(self.title) > 3 and self.title[-4] == '.'): | ||||||
|  |             extension = '' | ||||||
|  |         else: | ||||||
|  |             extensions = mimeTypes.get(self.context.contentType) or ['bin'] | ||||||
|             for ext in extensions: |             for ext in extensions: | ||||||
|                 if self.title.endswith('.' + ext): |                 if self.title.endswith('.' + ext): | ||||||
|                     extension = '' |                     extension = '' | ||||||
|  |                     break | ||||||
|  |             else: | ||||||
|  |                 extension = '.' + extensions[0] | ||||||
|         return '%s/d%s/%s%s' % (baseUrl, urlInfo.path, self.title, extension) |         return '%s/d%s/%s%s' % (baseUrl, urlInfo.path, self.title, extension) | ||||||
| 
 | 
 | ||||||
|     @property |     @property | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 helmutm
						helmutm