Thanks Daniel,

Using photo.path causes it to try to find the image in my MEDIA_ROOT, which
is not what I need. I need a way to get the path from the image upload
dialogue as encircled in the attached image.

The image is currently on my desktop and not in my media root and I need to
get the desktop path.

Thanks!

Lloyd

On Fri, Nov 26, 2010 at 4:14 PM, Daniel Roseman <dan...@roseman.org.uk>wrote:

> On Nov 26, 2:03 pm, Sithembewena Lloyd Dube <zebr...@gmail.com> wrote:
> > I found the issue: it is the path to the image. When I change the problem
> > line to
> >
> > image = Image.open(os.path.realpath('C:\Users\Lloyd\Desktop\Lloyd.png'))
> >
> > it works, but I cannot hard code the path and I cannot predict where the
> > user will try to upload a file from. Isn't there a way to dynamically get
> > the path from the file upload dialogue where the user browses to it and
> > selects it?
> >
> > Thanks...
>
> Why were you using photo.name as the path in the first place?
> photo.path stores the full path to the image, as noted in the
> documentation:
> http://docs.djangoproject.com/en/1.2/ref/files/file/
> --
> DR.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com<django-users%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>


-- 
Regards,
Sithembewena Lloyd Dube
http://www.lloyddube.com

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

<<attachment: photo_upload.png>>

Reply via email to