# payloadcms-ftp-storage

> FTP adapter for Payload CMS's plugin-cloud-storage plugin

Latest version **1.0.2** (published 2024-04-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install payloadcms-ftp-storage
pnpm add payloadcms-ftp-storage
yarn add payloadcms-ftp-storage
bun add payloadcms-ftp-storage
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2024-04-05 |
| First published | 2024-04-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 5.7 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | dr_mint |
| Maintainers | dr_mint |

## Links

- npm: https://www.npmjs.com/package/payloadcms-ftp-storage
- Repository: https://github.com/DrMint/payloadcms-ftp-storage
- Homepage: https://github.com/DrMint/payloadcms-ftp-storage#readme
- Issues: https://github.com/DrMint/payloadcms-ftp-storage/issues
- npm.io page: https://npm.io/package/payloadcms-ftp-storage

## Dependencies (2)

- [basic-ftp](https://npm.io/package/basic-ftp.md) ^5.0.5
- [@payloadcms/plugin-cloud-storage](https://npm.io/package/@payloadcms/plugin-cloud-storage.md) ^1.1.2

## Recent versions

- 1.0.2 (latest) — 2024-04-05
- 1.0.1 — 2024-04-05
- 1.0.0 — 2024-04-05

## README

# PayloadCMS FTP Storage Adapter

FTP adapter for Payload CMS's [plugin-cloud-storage](https://www.npmjs.com/package/@payloadcms/plugin-cloud-storage) plugin

This adapter uses [basic-ftp](https://www.npmjs.com/package/basic-ftp) to handle the FTP operations.

## Usage

Let's say we have a `Videos` collection (which slug is "videos") and we want to store the uploads on a third-party remote storage using FTP.

At the top of your `payload.config.ts` file, add the following:

```ts
import { ftpAdapter } from "payloadcms-ftp-storage";
```

Then within the `buildConfig` add the following:

```ts
plugins: [
  cloudStorage({
    collections: {
      videos: {
          adapter: ftpAdapter({
            host: "ftp.domain.com",
            user: "ftpUser",
            password: "ftpUserPassword",
            secure: true,
            endpoint: "https://domain.com/videos",
        }),
        disableLocalStorage: true,
        disablePayloadAccessControl: true,
      },
    },
  }),
],
```

If we upload a video file name "my-video.mp4", the file will be uploaded at the home of "ftpUser" at "ftp.domain.com", in a subfolder named "videos" (because this is the slug of the collection) as a file with the same name as the original "my-video.mp4". In conclusion, the path of the transfered file will be `~/videos/my-video.mp4`, and its public address will be `https://domain.com/videos/my-video.mp4`

Beware: when deleting an entry, the file will also be deleted on the remote storage. Also, if a file "my-video.mp4" already exists, and we try to upload another file with the same name, the original file will be overwritten.

---
_Source: https://npm.io/package/payloadcms-ftp-storage · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
