# saveFileToUserUploads()

This function is used to save a file from the user to the folder named user-uploads.

> Example

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

export default createBackendFunction(async function () {
  createRequestContext(this)
    .uploader()
    .onFile((info, file) => {
      // Will get the file information from the parameter info.
      utils.saveFileToUserUploads('/', 'imageName.jpeg', file);
    });
})
```

> An example of the usage is given in the [createUploader](../../../frontend/createuploader#backend-upload.server) section.

[Click here to refer GitHub.](https://github.com/skyslit/magicjs.dev/blob/main/packages/backend/src/utils.ts#L25)
