how to access uploaded file list in django forms.py

36 views
Skip to first unread message

ali Eblice

unread,
Aug 24, 2016, 4:13:23 PM8/24/16
to django...@googlegroups.com
Hello friends
how can i access uploaded file list (multi file upload) in forms.py ?

In a view i access file list like this :

request.FILES.getlist('files')

but in forms.py i get this error:

Exception Value:    'UploadForm' object has no attribute 'request'

i tried to add request object to my form , but i get error when using this code :

def clean_files(self):
    data = self.request.FILES


this is the error:

Exception Value:    'NoneType' object has no attribute 'FILES'

i want it for form validation
any help is really appreciated
Reply all
Reply to author
Forward
0 new messages