public PhysicalFileProvider operation;
public string basePath;
string root = "D:\\support\\controller";
public FileManagerController(IHostingEnvironment hostingEnvironment)
{
// Map the path of the files to be accessed with the host
this.basePath = hostingEnvironment.ContentRootPath;
this.operation = new PhysicalFileProvider();
// Assign the mapped path as root folder
this.operation.RootFolder(this.root);
}
|
var hostUrl = 'http://localhost:62869/';
var fileObject = new ej.filemanager.FileManager({
ajaxSettings: {
url: hostUrl + 'api/FileManager/FileOperations',
getImageUrl: hostUrl + 'api/FileManager/GetImage',
uploadUrl: hostUrl + 'api/FileManager/Upload',
downloadUrl: hostUrl + 'api/FileManager/Download'
},
view: 'Details'
});
fileObject.appendTo('#filemanager'); |
<system.webServer>
<httpProtocol>
<customHeaders>
<add name="Access-Control-Allow-Origin" value="*" />
<add name="Access-Control-Allow-Headers" value="Content-Type" />
<add name="Access-Control-Allow-Methods" value="GET, POST, PUT, DELETE, OPTIONS" />
</customHeaders>
</httpProtocol>
</system.webServer> |
can you pls help me i am getting same error in asp.net core after implement file manager in rich text editor .
Hi I am trying to deploy same approach but i am getting some error . i am using .net core.