Angular FileManager - Remote.Configuration
beforeAjaxSend
Type:
Function parameters:
options:
Object structure:
Name | Type | Description |
---|---|---|
formData |
Custom data (key/value pairs) that is sent to the server with the request. |
|
headers |
The request headers. |
|
xhrFields |
An object (fieldName/fieldValue pairs) to set on the native XMLHttpRequest object. |
NOTE
Use the beforeSubmit function to customize the file download requests.
app.component.html
app.component.ts
app.module.ts
- <dx-file-manager id="fileManager"
- [fileSystemProvider]="remoteFileProvider">
- <!-- ... -->
- </dx-file-manager>
- import { Component } from '@angular/core';
- import RemoteFileSystemProvider from 'devextreme/file_management/remote_provider';
- @Component({
- selector: 'app-root',
- templateUrl: 'app/app.component.html',
- styleUrls: ['app/app.component.css']
- })
- export class AppComponent {
- remoteFileProvider: RemoteFileSystemProvider;
- constructor(http: HttpClient) {
- this.remoteFileProvider = new RemoteFileSystemProvider({
- endpointUrl: "https://js.devexpress.com/Demos/Mvc/api/file-manager-file-system-scripts",
- beforeAjaxSend: function({ headers, formData, xhrFields }) {
- headers.RequestVerificationToken = document.getElementsByName("__RequestVerificationToken")[0].value;
- formData.dataValue = "some data";
- xhrFields.withCredentials = true;
- }
- });
- }
- }
- import { BrowserModule } from '@angular/platform-browser';
- import { NgModule} from '@angular/core';
- import { AppComponent } from './app.component';
- import { DxFileManagerModule } from 'devextreme-angular';
- @NgModule({
- imports: [
- BrowserModule,
- DxFileManagerModule
- ],
- declarations: [AppComponent],
- bootstrap: [AppComponent]
- })
- export class AppModule { }
beforeSubmit
Type:
NOTE
Use the beforeSubmit function to customize the file download requests only. To customize other Ajax requests (for example, file upload requests), use the beforeAjaxSend function.
app.component.html
app.component.ts
app.module.ts
- <dx-file-manager id="fileManager"
- [fileSystemProvider]="remoteFileProvider">
- <!-- ... -->
- </dx-file-manager>
- import { Component } from '@angular/core';
- import RemoteFileSystemProvider from 'devextreme/file_management/remote_provider';
- @Component({
- selector: 'app-root',
- templateUrl: 'app/app.component.html',
- styleUrls: ['app/app.component.css']
- })
- export class AppComponent {
- remoteFileProvider: RemoteFileSystemProvider;
- constructor(http: HttpClient) {
- this.remoteFileProvider = new RemoteFileSystemProvider({
- endpointUrl: "https://js.devexpress.com/Demos/Mvc/api/file-manager-file-system-scripts",
- beforeSubmit: function({ formData }) {
- formData.value = document.getElementsByName("__RequestVerificationToken")[0].value;
- }
- });
- }
- }
- import { BrowserModule } from '@angular/platform-browser';
- import { NgModule} from '@angular/core';
- import { AppComponent } from './app.component';
- import { DxFileManagerModule } from 'devextreme-angular';
- @NgModule({
- imports: [
- BrowserModule,
- DxFileManagerModule
- ],
- declarations: [AppComponent],
- bootstrap: [AppComponent]
- })
- export class AppModule { }
requestHeaders
Type:
any
Default Value: {}
NOTE
The requestHeaders option is not in effect for the file download requests.
app.component.html
app.component.ts
app.module.ts
- <dx-file-manager id="fileManager"
- [fileSystemProvider]="remoteFileProvider">
- <!-- ... -->
- </dx-file-manager>
- import { Component } from '@angular/core';
- import RemoteFileSystemProvider from 'devextreme/file_management/remote_provider';
- @Component({
- selector: 'app-root',
- templateUrl: 'app/app.component.html',
- styleUrls: ['app/app.component.css']
- })
- export class AppComponent {
- remoteFileProvider: RemoteFileSystemProvider;
- constructor(http: HttpClient) {
- this.remoteFileProvider = new RemoteFileSystemProvider({
- endpointUrl: "https://js.devexpress.com/Demos/Mvc/api/file-manager-file-system-scripts",
- requestHeaders: {
- YourHeaderName: "YourHeaderValue"
- }
- });
- }
- }
- import { BrowserModule } from '@angular/platform-browser';
- import { NgModule} from '@angular/core';
- import { AppComponent } from './app.component';
- import { DxFileManagerModule } from 'devextreme-angular';
- @NgModule({
- imports: [
- BrowserModule,
- DxFileManagerModule
- ],
- declarations: [AppComponent],
- bootstrap: [AppComponent]
- })
- export class AppModule { }
thumbnailExpr
The data field can contain one of the following:
- The icon's URL
- The icon's name if the icon is from the DevExtreme icon library
- The icon's CSS class if the icon is from an external icon library (see External Icon Libraries)
- The icon in the Base64 format
Feel free to share topic-related thoughts here.
If you have technical questions, please create a support ticket in the DevExpress Support Center.
Thank you for the feedback!
If you have technical questions, please create a support ticket in the DevExpress Support Center.