Hi All,
        Can anybody please tell how to upload a image ?
models.py

class photos(models.Model):
    caption = models.CharField(max_length=10)
    photo  = models.ImageField(upload_to= 'Path')

It works at Admin Side .But not working at client side.

MyHtml.html

<form action="/photopost/" method="post" enctype="multipart/form-data">
    <table border="1" width="500px" height="200px">
        <tr>
            <td>
                Caption :
            </td>
             <td>
                <input type="text" name="cap">
            </td>
        </tr>
        <tr>
            <td>
                Image :
            </td>
             <td>
                <input type="file" name="imgfile">
            </td>
        </tr>
        <tr>
            <td>
                &nbsp
            </td>
             <td>
                <input type="submit" value="Submit" >
            </td>
        </tr>
    </table>
</form>


What would be the views.py code ?

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