R
R
Roman Rakzin2017-10-07 20:51:29
ASP.NET
Roman Rakzin, 2017-10-07 20:51:29

How to get POST parameters and file in a form?

I submit a form with data and a file, but I can't then save the file and get the select option
value. I do this
string newPay_Money = Request.Form["newPay_Money"];
string newPay_Paket = Request.Form["newPay_Paket"]; //here I can't get the value select>option.value
string newPay_MyPurse = Request.Form["newPay_MyPurse"];
var files = Request.Form.Files;
how can i save the file?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Kuznetsov, 2017-10-08
@DarkRaven

The form must be with enctype = "multipart/form-data".
Further, I would recommend using some kind of model, rather than working directly with Request.
Does Request.Form even have it? Set a breakpoint at this point, and look in Watch what's there.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question