> Documentation index: https://www.gooddata.ai/docs/gooddata-ui/llms.txt lists every page of these docs as Markdown.

# IDataSourceFilesService

- Package: [@gooddata/sdk-backend-spi](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/index.md)
- Kind: interface
- Stability: alpha
- Source: https://github.com/gooddata/gooddata-ui-sdk/blob/rel/11.64/libs/sdk-backend-spi/src/dataSources/files.ts

> **Alpha API.** Initial API, highly likely to change outside SemVer. Don't build on it in production. See [API maturity](https://www.gooddata.ai/docs/gooddata-ui/latest/integrations/platform/api-maturity/index.md).
> 

Service to manage files of data sources that keep their data in files, for example CSV data sources.

**Signature:**

```typescript
export interface IDataSourceFilesService 
```

## Remarks

A file goes to a data source in three steps: upload it to the staging area, analyze it, and import it.

## Methods

| Method | Description |
| --- | --- |
| [analyzeCsv(requests)](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.idatasourcefilesservice/index.md#idatasourcefilesserviceanalyzecsv) | **_(ALPHA)_** Analyzes CSV files in the staging area. |
| [analyzeSav(requests)](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.idatasourcefilesservice/index.md#idatasourcefilesserviceanalyzesav) | **_(ALPHA)_** Analyzes SPSS (.sav) files in the staging area. |
| [deleteFiles(dataSourceId, fileNames)](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.idatasourcefilesservice/index.md#idatasourcefilesservicedeletefiles) | **_(ALPHA)_** Deletes files of a data source. |
| [getCsvManifests(dataSourceId, fileNames)](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.idatasourcefilesservice/index.md#idatasourcefilesservicegetcsvmanifests) | **_(ALPHA)_** Returns the options that the backend used to import CSV files into a data source. |
| [getFiles(dataSourceId)](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.idatasourcefilesservice/index.md#idatasourcefilesservicegetfiles) | **_(ALPHA)_** Returns files of a data source. |
| [importCsv(dataSourceId, tables)](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.idatasourcefilesservice/index.md#idatasourcefilesserviceimportcsv) | **_(ALPHA)_** Imports CSV files from the staging area into a data source. |
| [importSav(dataSourceId, tables)](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.idatasourcefilesservice/index.md#idatasourcefilesserviceimportsav) | **_(ALPHA)_** Imports SPSS (.sav) files from the staging area into a data source. |
| [upload(file)](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.idatasourcefilesservice/index.md#idatasourcefilesserviceupload) | **_(ALPHA)_** Uploads a file to the staging area. |

## Method details

### IDataSourceFilesService.analyzeCsv()

> **Alpha API.** Initial API, highly likely to change outside SemVer. Don't build on it in production. See [API maturity](https://www.gooddata.ai/docs/gooddata-ui/latest/integrations/platform/api-maturity/index.md).
> 

Analyzes CSV files in the staging area.

**Signature:**

```typescript
analyzeCsv(requests: ICsvAnalysisRequest[]): Promise<ICsvAnalysis[]>;
```

#### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| requests | [ICsvAnalysisRequest](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.icsvanalysisrequest/index.md)[] | files to analyze |

**Returns:**

Promise&lt;[ICsvAnalysis](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.icsvanalysis/index.md)[]&gt;

### IDataSourceFilesService.analyzeSav()

> **Alpha API.** Initial API, highly likely to change outside SemVer. Don't build on it in production. See [API maturity](https://www.gooddata.ai/docs/gooddata-ui/latest/integrations/platform/api-maturity/index.md).
> 

Analyzes SPSS (.sav) files in the staging area.

**Signature:**

```typescript
analyzeSav(requests: ISavAnalysisRequest[]): Promise<ISavAnalysis[]>;
```

#### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| requests | [ISavAnalysisRequest](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.isavanalysisrequest/index.md)[] | files to analyze |

**Returns:**

Promise&lt;[ISavAnalysis](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.isavanalysis/index.md)[]&gt;

### IDataSourceFilesService.deleteFiles()

> **Alpha API.** Initial API, highly likely to change outside SemVer. Don't build on it in production. See [API maturity](https://www.gooddata.ai/docs/gooddata-ui/latest/integrations/platform/api-maturity/index.md).
> 

Deletes files of a data source.

**Signature:**

```typescript
deleteFiles(dataSourceId: string, fileNames: string[]): Promise<void>;
```

#### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| dataSourceId | string | identifier of the data source |
| fileNames | string[] | names of the files to delete |

**Returns:**

Promise&lt;void&gt;

### IDataSourceFilesService.getCsvManifests()

> **Alpha API.** Initial API, highly likely to change outside SemVer. Don't build on it in production. See [API maturity](https://www.gooddata.ai/docs/gooddata-ui/latest/integrations/platform/api-maturity/index.md).
> 

Returns the options that the backend used to import CSV files into a data source.

**Signature:**

```typescript
getCsvManifests(dataSourceId: string, fileNames: string[]): Promise<ICsvFileManifest[]>;
```

#### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| dataSourceId | string | identifier of the data source |
| fileNames | string[] | names of the files |

**Returns:**

Promise&lt;[ICsvFileManifest](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.icsvfilemanifest/index.md)[]&gt;

### IDataSourceFilesService.getFiles()

> **Alpha API.** Initial API, highly likely to change outside SemVer. Don't build on it in production. See [API maturity](https://www.gooddata.ai/docs/gooddata-ui/latest/integrations/platform/api-maturity/index.md).
> 

Returns files of a data source.

**Signature:**

```typescript
getFiles(dataSourceId: string): Promise<IDataSourceFile[]>;
```

#### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| dataSourceId | string | identifier of the data source |

**Returns:**

Promise&lt;[IDataSourceFile](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.idatasourcefile/index.md)[]&gt;

### IDataSourceFilesService.importCsv()

> **Alpha API.** Initial API, highly likely to change outside SemVer. Don't build on it in production. See [API maturity](https://www.gooddata.ai/docs/gooddata-ui/latest/integrations/platform/api-maturity/index.md).
> 

Imports CSV files from the staging area into a data source.

**Signature:**

```typescript
importCsv(dataSourceId: string, tables: ICsvImportTable[]): Promise<ICsvImportResult[]>;
```

#### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| dataSourceId | string | identifier of the data source |
| tables | [ICsvImportTable](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.icsvimporttable/index.md)[] | tables to create or update from the files |

**Returns:**

Promise&lt;[ICsvImportResult](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.icsvimportresult/index.md)[]&gt;

### IDataSourceFilesService.importSav()

> **Alpha API.** Initial API, highly likely to change outside SemVer. Don't build on it in production. See [API maturity](https://www.gooddata.ai/docs/gooddata-ui/latest/integrations/platform/api-maturity/index.md).
> 

Imports SPSS (.sav) files from the staging area into a data source.

**Signature:**

```typescript
importSav(dataSourceId: string, tables: ISavImportTable[]): Promise<ISavImportResult[]>;
```

#### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| dataSourceId | string | identifier of the data source |
| tables | [ISavImportTable](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.isavimporttable/index.md)[] | tables to create or update from the files |

**Returns:**

Promise&lt;[ISavImportResult](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.isavimportresult/index.md)[]&gt;

### IDataSourceFilesService.upload()

> **Alpha API.** Initial API, highly likely to change outside SemVer. Don't build on it in production. See [API maturity](https://www.gooddata.ai/docs/gooddata-ui/latest/integrations/platform/api-maturity/index.md).
> 

Uploads a file to the staging area.

**Signature:**

```typescript
upload(file: File): Promise<string>;
```

#### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| file | File | file to upload |

**Returns:**

Promise&lt;string&gt;

location of the uploaded file, to use in the analysis and the import
