Regards,
Lloyd
On Fri, Nov 26, 2010 at 4:33 PM, Sithembewena Lloyd Dube <zebra05@gmail.com> wrote:
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!
LloydOn Fri, Nov 26, 2010 at 4:14 PM, Daniel Roseman <daniel@roseman.org.uk> wrote:
On Nov 26, 2:03 pm, Sithembewena Lloyd Dube <zebr...@gmail.com> wrote:Why were you using photo.name as the path in the first place?
> 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...
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-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@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-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
No comments:
Post a Comment