Changeset - bf5c2c75c976
[Not reviewed]
default
0 1 0
Marcin Kuzminski - 12 years ago 2013-07-01 11:20:59
marcin@python-works.com
fixes issue #856 file upload >1000 bytes on windows throws exception.

The returned object is a true file object on POSIX platforms.
On other platforms, it is a file-like object whose `file` attribute is the
underlying true file object. We check if such object has a file attribute
which is missing on POSIX platform
1 file changed with 4 insertions and 0 deletions:
0 comments (0 inline, 0 general)
rhodecode/controllers/files.py
Show inline comments
 
@@ -363,6 +363,10 @@ class FilesController(BaseRepoController
 
                filename = file_obj.filename
 
                content = file_obj.file
 

	
 
                if hasattr(content, 'file'):
 
                    # non posix systems store real file under file attr
 
                    content = content.file
 

	
 
            if not content:
 
                h.flash(_('No content'), category='warning')
 
                return redirect(url('changeset_home', repo_name=c.repo_name,
0 comments (0 inline, 0 general)