Sorry, i'm still new to programming in general so I'm not familiar
with that..

Wish i could help..

Good luck,
Molly


On Jul 16, 2:50 pm, d3f3nd3r <[EMAIL PROTECTED]> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Molly wrote:
> > Also, make sure you import ImageField at the top:
>
> > from django.db.models import ImageField
>
> > And, do you have the PIL downloaded??
> > Did you import Image?
>
> hello,
> I have another problem with file upload.
> request.FILES['file'] represents a dictionary in my view, not an object.
>
> Here is my code :
>         class UserPicForm(forms.Form):
>                 userpic  = forms.FileField()
>
>         form = UserPicForm(request.POST,request.FILES)
>         if form.is_valid() :
>             handle_userpic(request.FILES['userpic'])
>
>         def handle_userpic(f):
>         destination = open('/home/d3f3nd3r/hackerspace-os/mos/media/tmp', 
> 'wb+')
>         for chunk in f.chunks() : -> ERROR : 'FileDict' object has no 
> attribute 'chunks'
>                 destination.write(chunk)
>
> I think I followed the docs 
> athttp://www.djangoproject.com/documentation/upload_handling/but it didnt 
> work.
> Any ideas ?
>
> regards
>
>
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.6 (GNU/Linux)
> Comment: Using GnuPG with Mozilla -http://enigmail.mozdev.org
>
> iD8DBQFIfkLzM/NgBE4GzRgRAiTKAJ9ldZrJEpnkp2YhmSTCcGGv9BVg5QCgjVfr
> coc147x11eZsy9CJpsjw+rY=
> =yO8y
> -----END PGP SIGNATURE-----
--~--~---------~--~----~------------~-------~--~----~
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