On Mon, Oct 14, 2013 at 8:34 PM, Tom Evans <[email protected]> wrote:
> Yes, this is what I said before. Forms that contain files must be
> specified in the HTML differently than forms that do not contain
> files, or when the form is submitted, the file will not be submitted
> along with the form.
>
> Forms with files must have an encoding attribute set on the <form>
> element, eg "<form encoding='multipart/form-data' ....>". If they do
> not, files will not be submitted when the form is submitted.


Done..but again getting the same error. I am doing it like this:
This is my model:
image=models.ImageField(upload_to='images')

and then in my html form I am doing it like this:
<form action="" method="post" encoding='multipart/form-data'>
     {% csrf_token %}
         <table >
            {{ form.as_table }}
         </table>
         <input type="submit" value="Submit">
   </form>

-- 
Harjot Kaur Mann
Blog: http://harjotmann.wordpress.com/
Daily Dairy: http://harjotmann.wordpress.com/daily-diary/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAB0GQhBcGawwNxLYrphHuMeusH34EOuZO9Q5pDtpX%3D6ri1r%3D8g%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to