public ActionResult Upload(string path, IList<System.Web.HttpPostedFileBase> uploadFiles, string action)
{
if (path == null)
{
return Content("");
}
FileManagerResponse uploadResponse;
uploadResponse = operation.Upload(path, uploadFiles, action, null);
if (uploadResponse.Error != null)
{
HttpResponse Response = System.Web.HttpContext.Current.Response;
Response.Clear();
Response.Status = uploadResponse.Error.Code + " " + uploadResponse.Error.Message;
Response.StatusCode = Int32.Parse(uploadResponse.Error.Code);
Response.StatusDescription = uploadResponse.Error.Message;
Response.End();
}
return Content("");
}
filemanagerInstance = new ej.filemanager.FileManager({
ajaxSettings: {
url: hostUrl + 'FileManager/FileOperations',
getImageUrl: hostUrl + 'FileManager/GetImage',
uploadUrl: hostUrl + 'FileManager/Upload',
downloadUrl: hostUrl + 'FileManager/Download'
},
view: "Details",
width: "325px",
height: "200px",
allowDragAndDrop: true,
allowMultiSelection: false,
enablePersistence: true,
toolbarSettings: { visible: false },
beforeSend: function (args) {
var data = JSON.parse(args.ajaxSettings.data);
data["folderPath"] = path;
args.ajaxSettings.data = JSON.stringify(data);
}
});
Thanks,
William