# JSBlobLoaderBuilder

## Overview

The `JSBlobLoaderBuilder` utility facilitates constructing blob loader URLs for downloading or embedding data from a specified data provider. It supports configuration of data sources, file metadata, and database settings. ## Functionality

### URL Construction

* `build()` generates a blob loader URL string for use in custom HTML or as a redirect URL for direct downloads.

### Data Source Configuration

* `datasource(datasource)` specifies the server and table combination for the data provider.
* `serverAndTable(servername, tablename)` assigns the server and table names for the builder's column data provider.

### File Metadata

* `filename(filename)` sets the filename for the downloaded data, affecting the `Content-Disposition` header.
* `mimetype(mimetype)` specifies the MIME type of the data, applied in the `Content-Type` header.

### Row Management

* `rowid(rowid)` allows specifying single or composite primary keys for identifying rows in the data source.

## Methods Summarized

| Type                                                                                     | Name                                                                          | Summary                                                                                                                         |
| ---------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| [String](/reference/servoycore/dev-api/js-lib/string.md)                                 | [build()](#build)                                                             | Builds the blobloader url string that can be used in custom html or send to the browser as a redirect url for direct downloads. |
| [JSBlobLoaderBuilder](/reference/servoycore/dev-api/client-utils/jsblobloaderbuilder.md) | [datasource(datasource)](#datasource-datasource)                              | Sets the datasource (server/table combination) of the builder's column dataprovider.                                            |
| [JSBlobLoaderBuilder](/reference/servoycore/dev-api/client-utils/jsblobloaderbuilder.md) | [filename(filename)](#filename-filename)                                      | Sets the filename of the data in the dataprovider.                                                                              |
| [JSBlobLoaderBuilder](/reference/servoycore/dev-api/client-utils/jsblobloaderbuilder.md) | [mimetype(mimetype)](#mimetype-mimetype)                                      | Sets the mimetype of the data in the dataprovider.                                                                              |
| [JSBlobLoaderBuilder](/reference/servoycore/dev-api/client-utils/jsblobloaderbuilder.md) | [rowid(rowid)](#rowid-rowid)                                                  | Sets the rowid (single pk or composite pk) of the table.                                                                        |
| [JSBlobLoaderBuilder](/reference/servoycore/dev-api/client-utils/jsblobloaderbuilder.md) | [rowid(rowid)](#rowid-rowid)                                                  | Sets the rowids (single pk or composite pk) of the table.                                                                       |
| [JSBlobLoaderBuilder](/reference/servoycore/dev-api/client-utils/jsblobloaderbuilder.md) | [serverAndTable(servername, tablename)](#serverandtable-servername-tablename) | Sets the server name and table name of the builder's column dataprovider.                                                       |

## Methods Detailed

### build()

Builds the blobloader url string that can be used in custom html or send to the browser as a redirect url for direct downloads.

**Returns:** [String](/reference/servoycore/dev-api/js-lib/string.md) the blobloader url pointing to the data of the given dataprovider

### datasource(datasource)

Sets the datasource (server/table combination) of the builder's column dataprovider.

**Parameters**

* [String](/reference/servoycore/dev-api/js-lib/string.md) **datasource** The datasource for this builder's column dataprovider.

**Returns:** [JSBlobLoaderBuilder](/reference/servoycore/dev-api/client-utils/jsblobloaderbuilder.md) return the builder itself

### filename(filename)

Sets the filename of the data in the dataprovider.\
If given, it will set the Content-disposition header to: attachment; filename=filename

**Parameters**

* [String](/reference/servoycore/dev-api/js-lib/string.md) **filename** The filename for the data.

**Returns:** [JSBlobLoaderBuilder](/reference/servoycore/dev-api/client-utils/jsblobloaderbuilder.md) return the builder itself

### mimetype(mimetype)

Sets the mimetype of the data in the dataprovider.\
This will be set in the content type header of the response for this data.

**Parameters**

* [String](/reference/servoycore/dev-api/js-lib/string.md) **mimetype** the mime type of the data (set as the content type header)

**Returns:** [JSBlobLoaderBuilder](/reference/servoycore/dev-api/client-utils/jsblobloaderbuilder.md) return the builder itself

### rowid(rowid)

Sets the rowid (single pk or composite pk) of the table.

**Parameters**

* [Object](/reference/servoycore/dev-api/js-lib/object.md) **rowid** The rowid, can be a single value or an array of values

**Returns:** [JSBlobLoaderBuilder](/reference/servoycore/dev-api/client-utils/jsblobloaderbuilder.md) return the builder itself

### rowid(rowid)

Sets the rowids (single pk or composite pk) of the table.

**Parameters**

* [Array](/reference/servoycore/dev-api/js-lib/array.md) **rowid** The rowid; can be a single value or an array of values.

**Returns:** [JSBlobLoaderBuilder](/reference/servoycore/dev-api/client-utils/jsblobloaderbuilder.md) return the builder itself

### serverAndTable(servername, tablename)

Sets the server name and table name of the builder's column dataprovider.

**Parameters**

* [String](/reference/servoycore/dev-api/js-lib/string.md) **servername** The servername for this builder's column dataprovider.
* [String](/reference/servoycore/dev-api/js-lib/string.md) **tablename** The tablename for this builder's column dataprovider.

**Returns:** [JSBlobLoaderBuilder](/reference/servoycore/dev-api/client-utils/jsblobloaderbuilder.md) return the builder itself

***


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.servoy.com/reference/servoycore/dev-api/client-utils/jsblobloaderbuilder.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
