Re: Form attachment (FileField) upload not saving.

2010-12-08 Thread Sithembewena Lloyd Dube
100% fixed. I was calling save() on the form twice, once in form_capture and once in form_errors. :( On Wed, Dec 8, 2010 at 12:34 PM, Sithembewena Lloyd Dube wrote: > 50% solved - I passed request.FILES into the form's constructor as > indicated below: > > http://docs.djangoproject.com/en/1.2/

Re: Form attachment (FileField) upload not saving.

2010-12-08 Thread Sithembewena Lloyd Dube
50% solved - I passed request.FILES into the form's constructor as indicated below: http://docs.djangoproject.com/en/1.2/topics/http/file-uploads/ I then accessed the file as follows: attachment = request.FILES['attachment'] Only problem left is to figure out why the form is posting twice. ide

Form attachment (FileField) upload not saving.

2010-12-08 Thread Sithembewena Lloyd Dube
Hi all, I have a contact form that is supposed to save a message as well as a file upload. When I use the admin site, I can save a contact record with a file upload of any type. However, saving from the 'front end' of my web application causes some strange behaviour - the file is not uploaded, an