I am using uploadify to upload multiple on the server…
below is my html markup
<%using (Html.BeginForm("MultiUpload", "Home", FormMethod.Post))
{ %>
<div id="InterestingDiv">
<a href="javascript:$('#fileInput1').uploadifyUpload();" class="uploadLink" title="Click to Upload Files">Upload Files</a>
<input id="fileInput1" name="File" type="file" />
</div>
<%}%>
and how I have declared the script…
<link href="<%:Url.Content("~/Content/themes/base/jquery.ui.all.css") %>" rel="stylesheet" type="text/css" />
<link href="<%:Url.Content("~/jquery.uploadify-v2.1.4/uploadify.css") %>" rel="stylesheet" type="text/css" />
<script src="<%:Url.Content("~/jquery.uploadify-v2.1.4/jquery-1.4.2.min.js") %>" type="text/javascript"></script>
<script src="<%:Url.Content("~/jquery.uploadify-v2.1.4/swfobject.js") %>" type="text/javascript"></script>
<script src="<%:Url.Content("~/jquery.uploadify-v2.1.4/jquery.uploadify.v2.1.4.js") %>" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function () {
$("#fileInput1").uploadify({
'uploader': '<%:Url.Content("~/jquery.uploadify-v2.1.4/uploadify.swf")%>',
'script': '<%: Url.Action("MultiUpload") %>',
'auto': false,
'multi': true,
'expressInstall': '<%:Url.Content("~/jquery.uploadify-v2.1.4/expressInstall.swf")%>',
'cancelImg': '<%: Url.Content("~/jquery.uploadify-v2.1.4/cancel.png") %>',
'scriptAccess': 'always',
'buttonText': 'Browse Files...',
'hideButton': false,
'folder': '<%:Url.Content("~/Content/") %>',
'fileDesc': 'Excel Files',
'fileExt': '*.xlsx',
'fileDataName': 'File',
'sizeLimit': 1000000000,
onError: function (a, b, c, d) {
if (d.status == 404)
alert("Could not find upload script. Use a path relative to: " + "<?= getcwd() ?>");
else if (d.type === "HTTP")
alert("error " + d.type + ": " + d.status);
else if (d.type === "File Size")
alert(c.name + " " + d.type + " Limit: " + Math.round(d.sizeLimit / 1024) + "KB");
else
alert("error " + d.type + ": " + d.text);
}
});
});
</script>
below goes my controller code…
public ActionResult MultiUpload(HttpPostedFileBase File)
{
//handle file here
return Json(new { status = true });
}
my code is successfully working on the development environment but as soon as i deploy it on the iis7 either local iis or server iis, it is not hitting my MultiUpload action…
I simple want to implement multiple file selecting and uploading it…
You’ll have to give folder permissions in IIS, right click on the folder in which you’re uploading your files go to properties and in Security tab you’ll have to give full rights to IISusers and Network users otherwise you’ll not be able to upload files