1π
β
In python you can get that using name attribute.,.
newdoc = request.FILES['docfile']
newdoc.name # file name
Andv if you wish to see that in the template here is the code
{% for document in documents %}
{{ document.file.filename }}
{% endfor }}
In the model objects
newdoc = Document.objects.get(id=1)
newdoc.docfile.url # url of the file
newdoc.docfile.path # exact path
π€Raja Simon
Source:stackexchange.com