let fileObject: FileManager = new FileManager({
ajaxSettings: {
url: hostUrl + "api/FileManager/FileOperations",
getImageUrl: hostUrl + "api/FileManager/GetImage",
uploadUrl: hostUrl + "api/FileManager/Upload",
downloadUrl: hostUrl + "api/FileManager/Download"
},
view: "Details",
beforeSend: function(args) {
var data = JSON.parse(args.ajaxSettings.data);
// Add custom parameter column
data["column"] = true;
// Add custom parameter in ajax settings
args.ajaxSettings.data = JSON.stringify(data);
}
});
fileObject.appendTo("#filemanager");
|
public object FileOperations([FromBody] FileManagerDirectoryContent1 args)
{
if(args.column)
{
root = "wwwroot\\Files";
}
else
{
root = "wwwroot\\Files\\Documents";
}
this.operation.RootFolder(this.basePath + "\\" + this.root);
}
public class FileManagerDirectoryContent1
{
...
...
public string TargetPath { get; set; }
public string ParentId { get; set; }
public string FilterId { get; set; }
public string FilterPath { get; set; }
public bool column { get; set; }
} |