Hi Jyoti,
Greetings from Syncfusion support.
With the shared details, you need to pass the JWT token from
the client to the server side in the React FileManager GetImage operation. We
would like to let you know that we can’t add the JWT token with this request.
However, we have used the Query parameter for the GetImage operations of the
FileManager component. To achieve your requirement, you just need to use the
below code details in the FileManager beforeImageLoad
event.
Refer to the below code snippet.
[index.js],
export class Overview extends SampleBase {
onbeforeImageLoad(args) {
// Add
custom parameter in image URL
args.imageUrl = args.imageUrl + '&rootName=' + 'TokenValue';
}
hostUrl = 'http://localhost:62869/';
render() {
return (
<div>
<div className="control-section">
<FileManagerComponent
id="overview_file"
...
}}
view={'Details'}
beforeImageLoad={this.onbeforeImageLoad}
>
<Inject services={[NavigationPane, DetailsView, Toolbar]} />
</FileManagerComponent>
...
|
[FileManager.Controller.cs],
namespace EJ2APIServices.Controllers
{
public class FileManagerDirectoryContent1
{
...
public string rootName { get; set; }
...
public IActionResult GetImage(FileManagerDirectoryContent1
args)
{
var root =
args.rootName;
return this.operation.GetImage(args.Path,
args.Id,false,null, null);
}
|
Sample: https://stackblitz.com/edit/react-ztpxhq?file=index.js,index.html
Service provider: https://www.syncfusion.com/downloads/support/directtrac/general/ze/ej2-aspcore-file-provider2082500053.zip
Check out the attached sample for your reference.