On Fri, Feb 7, 2014 at 3:25 PM, Ashish Tiwari <ashish...@gmail.com> wrote:

> It's a simple question but i'm not able to find easily.
> How can I display the file extension of uploaded file in template ?
>
> ex : uploaded-filename.jpeg
>       {{file.<extension>}} will display "jpeg" in template.
>

There isn't anything builtin to do this, but it would be a really to write
a custom template tag that was a simple wrapper around os.path.splitext().
See:

https://docs.djangoproject.com/en/1.6/howto/custom-template-tags/

For details on how to write a custom template tag.

Yours,
Russ Magee %-)

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
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/CAJxq849RY5XqGu56YA7fX-TZWDbyxUoZ%3DiQPzRfa4QCzoGuQuA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to