I need to add a form that has a field that will allow users to upload either documents (.pdf, etc) or images (.png, .jpeg, etc). I know Django has the model fields FileField and ImageField.
How would I create a form that detects the type of upload and uses the correct field type?