mk8efz
mk8efz

Reputation: 1424

Getting File from form field in Django

Similar to this question:

How to get value from form field in django framework?

Except the "value" field is a file. Is there a way to grab it directly? I called .value() on the field but it does not seem to be working.

Upvotes: 1

Views: 123

Answers (1)

Aaron Lelevier
Aaron Lelevier

Reputation: 20780

FileField's are objects.

To access the file, simply call:

<file_field_instance>.file

Upvotes: 2

Related Questions