asp.net mvc 3 - Request.Form[] return's null -


i used file controller , allow user upload file name

  @using (html.beginform("attachfile", "coursework", new { enctype = "multipart/form-data" }, formmethod.post)) {   @html.hiddenfor(model => model.prtfmaster.iconfilename, new { @id = "filename" })  <input type="file" name="file" id="file1"/>} 

on controller write this:

  public actionresult uploadprtfassgmnt(formcollection form,httppostedfilebase file,coursework cwork) 

with i'm able fetch uploaded file name inside function if try value this:

 string filename = request.form["filename"]; 

it returning null.

can me this? please


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -