Hello all,
I am uploading some text files through django (using a form FileField),
and I am getting InMemoryUploadedFile objects this way. In my
handle_uploaded_subtitles() method, which gets the list of
InMemoryUploadedFile objects, I would like to compress these files (so
that I will get either gzip or bzip2 file, and then save it to a
FileField model field.
Currently, I have a this code:
def handle_uploaded_subtitles(self, files):
for file in files:
sub_file = SubtitleFile(file_name=file.name, etc)
# here I need to compress the file
sub_file.file.save(file.name, file)
Does anyone here have an idea how can I accomplish this?
Thanks!
--
Kind regards
Daniel
--
You received this message because you are subscribed to the Google Groups "Django
users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.