When I ran through this problem, there were a couple of things I was doing
wrong, none of which had to do with jpeg support.

Eventually, I found that my major problem was that my media directory (where
the upload directory resides) was not set properly in Apache.  It was not
writeable.  In my windows system's apache httpd.conf, I had to add this:

Alias /media/ "C:/Program Files/Apache Software
Foundation/Apache2.2/htdocs/django/media/"
<Directory "C:/Program Files/Apache Software
Foundation/Apache2.2/htdocs/django/media/">
Order allow,deny
Options -Indexes
Allow from all
</Directory>


On Mon, Oct 5, 2009 at 6:41 PM, tdelam <[email protected]> wrote:

>
> Hey, I keep receiving this message on the production server when I try
> to upload an image through the admin interface: Upload a valid image.
> The file you uploaded was either not an image or a corrupted image.
> Does anyone have a suggestion as to why? I was told it could be a PIL
> issue not compiled with jpeg support but I do remember spending some
> time compiling PIL to get things working and jpeg support works. I
> also have django-filebrowser successfully uploading images to another
> project... Anyone have another suggestion as to why I am receiving
> this error?
>
> Here is a simple test through console.
>
> Python 2.5.4 (r254:67916, Sep 27 2009, 20:37:29)
> [GCC 3.4.6 20060404 (Red Hat 3.4.6-11)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> from PIL import Image
> >>> image = Image.open("/var/django/projects/hockey/media/images/goal.jpg")
> >>> image.format
> 'JPEG'
> >>>
>
> Here is my model:
>
> class Roster(models.Model):
>        name = models.CharField(max_length=100)
>        position = models.CharField(max_length=100)
>        image = models.ImageField(upload_to='roster_uploads')
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
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