# HG changeset patch # User Marcin Kuzminski # Date 2013-07-01 09:20:59 # Node ID bf5c2c75c976bccd05bea1eaa733bdbca2bfa4dd # Parent 35fcc232f652b4d69a758a0ee071c6e17f156c9c 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 diff --git a/rhodecode/controllers/files.py b/rhodecode/controllers/files.py --- a/rhodecode/controllers/files.py +++ b/rhodecode/controllers/files.py @@ -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,