Howto intercept Filemanage ajax call to use clientproxy ?

Hi Syncfusion Support,

the filemanager uses url for to operate like this :
FileOperationsUrl = "https://localhost:5000/api/app/filemanager/fileoperations"


We use clientproxies, which are defined like this:

sample.controllers.fileManager.fileManager.fileOperations = function(args, ajaxParams) {

return abp.ajax($.extend(true, {

url: abp.appPath + 'api/app/filemanager/fileoperations',

type: 'POST',

data: JSON.stringify(args)

}, ajaxParams));

};

sample.controllers.fileManager.fileManager.download = function(downloadInput, ajaxParams) {

return abp.ajax($.extend(true, {

url: abp.appPath + 'api/app/filemanager/download' + abp.utils.buildQueryString([{ name: 'downloadInput', value: downloadInput }]) + '',

type: 'POST'

}, ajaxParams));

};

i did try to change that Url to:
FileOperationsUrl = " sample.controllers.fileManager.fileManager.fileOperations ", but this didn't work.

infos about clientproxies:

https://docs.abp.io/en/abp/latest/UI/AspNetCore/Dynamic-JavaScript-Proxies

https://docs.abp.io/en/abp/latest/UI/AspNetCore/JavaScript-API/Ajax


Similiar question here:
https://www.syncfusion.com/forums/137627/intercept-requests-from-datamanager


How can i intercept filemanager ajax call to use these proxies. these proxies handle automatically antifogery token and authorization as well.


I did find infos about, howto get the XSFR Token and Oauth Token (making a call with additional javsscripts) and set them in the BeforeSend Event, but using clientproxies would be a better solution.

How can this be achieved ?






1 Reply

SA Shameer Ali Baig Sulaiman Ali Baig Syncfusion Team February 23, 2022 11:19 AM UTC

Hi Hakan, 
 
Greetings from Syncfusion support. 
 
We would like to let you know that EJ2 FileManager has in-built AJAX functionality for access and manage data. The ajaxSettings must be defined while initializing the file manager. File manager utilizes the URL’s mentioned in ajaxSettings to send file operation request to the server. The File Manager service link is given in hostUrl. We cannot use custom AJAX for request and loading the data to the FileManager component. 
 
We suspect you are expecting to send authorization token in server call request. Please, check out the following to achieve this requirement with FileManager. 
 
 
Please, let us know if you need any further assistance. 
 
Regards, 
Shameer Ali Baig S. 


Loader.
Up arrow icon