Hello,

I'm trying to populate an ImageField with the content of an image from
it's url. I'm trying with the following code :

-----------
# image_uri is the URL of my image
# new_photo.photo is the ImageField field of my new_photo instance
current_file = File(urllib.urlopen(image_uri))
current_file.name = os.path.basename(image_uri)
new_photo.photo.save(os.path.basename(image_uri),current_file)
-----------

but I get an AttributeError : addinfourl instance has no attribute
'name'. Has anyone an idea on how to solve that ?

Thanks
-- 
Fabien

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to