Hi friends, still getting same error after using encrypt..

Bt if i am using request. POST. get('document') then error vanishes but
another error comes as job_title is an invalid keyword argument for this
function.

Kindly help on this issue. I m trying hard but unable to solve.

Thanks

On Thu, 16 May, 2019, 6:42 PM Test Bot, <[email protected]> wrote:

> Try putting encrypt="multipart/form-data" in your form tag
>
> On Thu, May 16, 2019, 6:05 PM Sipum <[email protected]> wrote:
>
>> Hi Friends,
>>
>> when retrieving file that is uploaded , I'm getting
>> multiValueDictKeyError.
>> Below are my codes. I have proided some codes where I m getting error.
>> could anyone help me here ?
>>
>> views.py
>> -------------
>>
>> def webform_submit(request):
>>     if request.method =='POST':
>>         name = request.POST['name']
>>         email = request.POST['email']
>>         phone = request.POST['phone']
>>         job_title = request.POST['job_title']
>>         resume = request.FILES['document']                   -- getting
>> error here
>>
>>         user_info = UserField(name = name, email = email, phone = phone,
>>                               job_title = job_title, resume = resume)
>>         user_info.save()
>>         messages.success(request,"Congrats!! Form is successfully saved
>> in DB")
>>         return render(request, 'html/form.html', {})
>>
>>
>> form.html
>> ------------------
>>                                       </div>
>> <label>Job title</label>
>> <input type="text" name="job_title" placeholder="Job Title" required>
>>
>> <div class="form-group">
>>     <label for="exampleFormControlFile1">Resume</label>
>>     <input type="file" name="document" class="form-control-file"
>> id="exampleFormControlFile1">
>>   </div>
>> <input type="submit" value="Submit">
>> </form>
>>
>> thank you.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/37a3ca49-6410-420f-a6a6-23bcf8e3f983%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/37a3ca49-6410-420f-a6a6-23bcf8e3f983%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAD%3DM5eQp8%3DBZVmDe7RFjdf0LOvoZcdGMqGgt0xSdEw_Nj%2BJaig%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAD%3DM5eQp8%3DBZVmDe7RFjdf0LOvoZcdGMqGgt0xSdEw_Nj%2BJaig%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAGHZBzyWYUF8JsBuAU3PeHp%2BnWGqadp%3DJz_vW7yHzYZUm-yXqA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to