# createSrc()&#x20;

> Here is an example:

#### Frontend:

```typescript
import { createUploader, createSrc } from '@magicjs.dev/frontend';
import getFileServer from './get-file.server'; // The backend server function for reading files

const fileSrc = createSrc(getFileServer);

return (
  <div>
    <img src={fileSrc.getLink('fileName.jpg')} alt="File Preview" />
  </div>
);
```

#### Backend `get-file.server`

```typescript
import { createBackendFunction, utils } from '@magicjs.dev/backend';

export default createBackendFunction(async function (fileName: string) {
  return utils.readFileFromUserUploads('/path', fileName);
});
```

[Click here to refer GitHub.](https://github.com/skyslit/magicjs.dev/blob/main/packages/frontend/src/file-uploader.tsx#L61)


---

# 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://skyslit.gitbook.io/magicjs/api-references/frontend/createsrc.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.
