Hi Friends,
i have done multiple pdf file uploading in Local It perfectly working but after moved to server..
it will not working...
Error: is Time out
please Help Thanks in Advance
public ActionResult UploadCustomerFiles(string Foldername)
{
// string path = Server.MapPath("~/Content/Upload/" + keyword + "/");
string path = Server.MapPath("~/Upload_Files/" + Foldername + "/");
HttpFileCollectionBase files = Request.Files;
for (int i = 0; i < files.Count; i++)
{
HttpPostedFileBase file = files[i];
file.SaveAs(path + file.FileName);
}
return Json(files.Count + " Files Uploaded!");
}
@using (Html.BeginForm("Uploadfiles", "Order", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
<div id="div_file">
<div id="div_file_upload" class="col-lg-12 col-md-12 col-sm-12 col-xs-12 portlet light">
<div class="box box-primary" >
<div class="box-header with-border">
<h3 class="box-title" style="font-weight: bold; color: #3c8dbc;">
<strong>Upload File</strong> (choose .pdf file only)
</h3>
</div>
</div>
</div>
$("#btn_uploadfile").click(function (e) {
var files = $("#txt_file_upload").get(0).files;
if (files.length > 50)
{
$('#txt_file_upload').val('');
swal("", "Please upload Maximum 50 files!", "error");
return false;
}
var Foldername = $('#sel_Choose_folder').val();
var fileData = new FormData();
for (var i = 0; i < files.length; i++) {
fileData.append("txt_file_upload", files[i]);
}
fileData.append("Foldername", Foldername);
UploadPDFFiles(fileData, Foldername);
e.stopImmediatePropagation();
});
var UploadPDFFiles = function (fileData, Foldername) {
$.ajax({
type: "POST",
url: "Order/UploadCustomerFiles",
contentType: false,
processData: false,
async: false,
data:fileData,
cache: false,
success: function (data) {
$('#txt_file_upload').val('');
swal("Success", "Files Uploaded Successfully", "success");
},
error: function (result) {
alert("Error: " + result.statusText);
},
beforeSend: function () {
// $('.loading-container').show();
},
complete: function () {
// $('.loading-container').hide();
}
});
};