diff options
| -rw-r--r-- | ishtar_common/data_importer.py | 4 | 
1 files changed, 4 insertions, 0 deletions
| diff --git a/ishtar_common/data_importer.py b/ishtar_common/data_importer.py index a2d1f40d2..481098244 100644 --- a/ishtar_common/data_importer.py +++ b/ishtar_common/data_importer.py @@ -495,11 +495,15 @@ class FileFormater(Formater):          filename = settings.MEDIA_ROOT + 'imported/' + \              u".".join(items[:-1]) + u'.' + items[-1]          try: +            current_size = 0              with open(filename, 'w') as f:                  with zp.open(value) as z:                      f.write(z.read()) +                current_size = f.size              f = open(filename, 'r')              my_file = File(f) +            # manualy set the file size because of an issue with TempFile +            my_file.size = current_size              return my_file          except KeyError:              raise ValueError(_(u"\"%(value)s\" is not a valid path for the " | 
