I have users dumping jpgs into a folder within the media root, the
idea is to monitor this folder and programmatically add the jpgs to
certain model instances based on a naming convention. It all works
fine... except... every time i put a jpg in File object and save to a
model the  jpg gets corrupted.

I've tried with both regular File() object and default_storage.

f = open('%s' % infile, 'w')
file = File(f)
#file = default_storage.open(infile, 'wb')
ProductImage.objects.create(product=product,sort=sort,picture=file)

what am i missing here - should i be using PIL in some way?
--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to