i need to pass the file name from Django template to views.py . It works fine if i am passing one file name ,but when it comes to multiple file i am able to select multiple files but in views.py only the first file is showing . BTW i am new to Django . Please correct me if i am going worng.
Html code :
<form method="post" action="add" enctype='multipart/form-data'>
{% csrf_token%}
<div class="form-group files">
<label>Upload Your File </label>
<input type="file" class="form-control" name="num1[]"
multiple/>
<button type="submit" class="form-control">Submit</button>
</div>
</form>
Python code :
def add(request):
val1 = request.POST['num1']
print(val1)
Expect result : [File1 , File2]
list or dictionary is fineActual result : file1
#needed both file names