You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: ej2-asp-core-mvc/file-manager/how-to/pass-custom-value-to-server.md
+24-24Lines changed: 24 additions & 24 deletions
Original file line number
Diff line number
Diff line change
@@ -181,7 +181,7 @@ public object Download([FromBody] FileManagerDirectoryContent args)
181
181
182
182
## 4. For GetImage Operation
183
183
184
-
For the **GetImage** operation, use the **beforeImageLoad** event to pass custom value. Since the **GetImage**operation doesn't support custom headers in HTTP requests, pass the custom values along with **imageUrl**using query parameters instead.
184
+
For the **GetImage** operation, use the **beforeImageLoad** event. Inside this event, set **useImageAsUrl**to false to instruct the FileManager not to load the image directly via its URL but instead to use a fetch request. Here, attach the **Authorization** header with the value **User1**within the beforeSend event of the ajaxSettings.
185
185
186
186
{% if page.publishingplatform == "aspnet-core" %}
187
187
```ts
@@ -200,7 +200,14 @@ For the **GetImage** operation, use the **beforeImageLoad** event to pass custom
In server-side, you can able to get the custom query parameter value using **Authorization** in `GetImage` method. To get the custom query parameter value, extend the `FileManagerDirectoryContent` class and add the custom property **Authorization**.
233
-
246
+
In server-side, `GetImage` method access the **Authorization** header from the incoming HTTP request and perform the necessary operations.
> **Note:** View the complete [Github sample](https://github.com/SyncfusionExamples/How-to-pass-custom-values-from-client-to-server-in-filemanager) which includes all the above event along with service code for passing custom values to server.
0 commit comments