How to access file on server side when auto property is false??

Posted by Laghaterohan under C# on 7/25/2012 | Points: 10 | Views : 1102 | Status : [Member] | Replies : 0
I am using following js to upload the file with auto property set to false as below:

<script type="text/javascript">
function () {
'uploader': '/Scripts/uploader.swf',
'script': "@Url.Action("Add", "Order")",
'cancelImg': '/Images/cancel.png',
'buttonText': 'Select Image',
'fileDesc': 'Image Files',
'fileExt': '*.jpg;*.jpeg;*.gif;*.png',
'multi': true,
'auto': false });

In my controller Order I have Add action which is as below :

public ActionResult Add(HttpPostedFileBase fileData)  // fileData is NULL and hence cannot access file

var fileName = @"C:\Uploads\" + System.IO.Path.GetFileName(fileData.FileName);
return View();

If i set auto:true i get the HttpPostedFileBase object whereas if I set to false I get it null hence cannot access the file.

Please guide, what I need to do?? so that I can access the file on server when my auto property is false.??

Please help...

Best Regards,
Rohan Laghate


(No response found.)

Login to post response