Hello,
I am using following js to upload the file with auto property set to false as below:
<script type="text/javascript">
$(window).load(
function () {
$("#fileuploader").fileUpload({
'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 });
}
);
</script>
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);
fileData.SaveAs(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