BaptisteAg / strapi4-ftp-provider

A custom provider for strapi 4 to use ftp for the media library plugin
1 stars 7 forks source link

Thumbnails do not appear in media library #7

Open henriquezolini opened 1 year ago

henriquezolini commented 1 year ago

I'm using your plugin and even with the settings but the thumbnails do not appear in media library. can you help me?

image

image

plugins.js

module.exports = ({ env }) => ({
  upload: {
    config: {
      provider: "strapi4-ftp-provider",
      providerOptions: {
        host: env("FTP_HOST"),
        port: env("FTP_PORT"),
        user: env("FTP_USER"),
        password: env("FTP_PASSWORD"),
        secure: env.bool("FTP_SECURE", false),
        path: env("FTP_BASE_PATH"),
        baseUrl: env("FTP_BASE_URL"),
      },
    },
  },
});

middlewares.js

module.exports = ({ env }) => [
  "strapi::errors",
  {
    name: "strapi::security",
    config: {
      contentSecurityPolicy: {
        useDefaults: true,
        directives: {
          "connect-src": ["'self'", "https:"],
          "img-src": ["'self'", "data:", "blob:", env("FTP_BASE_URL")],
          "media-src": ["'self'", "data:", "blob:", env("FTP_BASE_URL")],
          upgradeInsecureRequests: null,
        },
      },
    },
  },
  "strapi::cors",
  "strapi::poweredBy",
  "strapi::logger",
  "strapi::query",
  "strapi::body",
  "strapi::session",
  "strapi::favicon",
  "strapi::public",
];

.env

FTP_HOST=myserver
FTP_PORT=21
FTP_USER=myuser
FTP_PASSWORD=mypassword
FTP_SECURE=true
FTP_BASE_PATH=/
FTP_BASE_URL=https://mydomain.com.br/strapi_uploads
henriquezolini commented 1 year ago

I just found the problem, you forgot to update the npm version with your latest changes. Could you update? My interim solution was to add github url in package.json

"strapi4-ftp-provider": "https://github.com/BaptisteAg/strapi4-ftp-provider"

fretif commented 1 year ago

@BaptisteAg Can you release a new npm version with your latest changes ?

henriquezolini commented 11 months ago

The project seems abandoned, I'm upset, my clients can no longer bear paying Cloudnary's absurd prices. This would be an excellent option.

yanickdi commented 4 months ago

i can confirm, had the same problem @henriquezolini you may use npm i https://github.com/BaptisteAg/strapi4-ftp-provider