Menu

#8699 (S)FTP plugin

Parent Category:
DPMedia
Category:
Image Services
Last Updated:
Allon Moritz, Wednesday, 20 December 2023 11:06
Created:
Thursday, 12 August 2021 12:10
Hits:
2090

DownloadPHP 8Joomla 4.4Joomla 5

Introduction

The FTP plugin integrates media data from an FTP or SFTP server into the Joomla core media manager. It allows the admin to select images in articles and any other extension which uses the core media manager. Beside that it is possible to create folders, upload images, rename and delete the data directly from within Joomla on the (S)FTP server. It's possible to add unlimited different (S)FTP servers in the plugin.

Please read the Concept of image service provider integration article to get more information how to get started with the image service provider plugins from DPMedia.

(S)FTP integration into Joomla

Add an (S)FTP account

Adding a (S)FTP account is rather straightforward. To do so, open the filesystem FTP plugin in the plugin manager in the back end of your Joomla site. Click on the green "+" button in the plugin edit form. Copy the credentials and server settings into the form. Click the "Save" button in the toolbar of the plugin.

If key file authentication is needed instead of the less secure password mechanism, define a private key file in the respective parameter. The web server needs read permission to the key file and with "ssh-copy-key" should the public key be copied to the SSH server, so no prompt is executing while connecting to the server. More information about passwordless SFTP access can be found here.

(S)FTP folder

Media files locally

During the list fetch the image files are copied from the (S)FTP server to the local filesystem on a path the site admin can define for thumbnail generation. Each file will be saved with the last modification timestamp to ensure that the updates are immediately reflected locally. As (S)FTP doesn't allow public HTTP links to a file, the files are served from the web servers local drive. The files are stored in the configured path.

If the file is an image it is also possible to define a custom width and height, so the drive of the Joomla site will not fill up quickly.

(S)FTP local images params

Thumbnails

As (S)FTP doesn't support public links for thumbnails, DPMedia creates them on the fly for the media list, the thumbnails are not used anywhere else. It does it by downloading the original file and creates a thumbnail out of it while fetching the images list. In the options the admin can define per account where the thumbnails should be stored on the local filesystem.

DPMedia is fetching only 10 thumbnails per request, otherwise it it can reach the execution time on large (S)FTP folders. So if an image has no local thumbnail a default placeholder will be shown instead.

Automatic resize

The plugin supports automatic resize when images are uploaded. The images are only scaled down, but not up. The admin can choose between the following four options when resizing should be applied:

  • No
    No resizing is performed.
  • On upload
    Images are resized on upload only. Existing images do keep their dimensions.

When only a width or height is set, then a resize is performed and the aspect ratio is kept. Like that will all images have the same width or height. When both dimensions are set, then an option is shown which lets you define if the aspect ratio should be kept or not. If it is not kept, then each image has the same dimensions but the smaller side gets cropped. Here are some examples listed for a better understanding:

Image dimensions Force width Force Height Keep aspect ratio Resized image dimensions Crop
2000 x 3000 0 400 267 x 400 No
2000 x 3000 400 0 400 x 750 No
2000 x 3000 400 100 No 400 x 100 Height is cropped from 750 to 100
2000 x 3000 400 100 Yes 67 x 100 No
2000 x 3000 100 400 No 100 x 400 Width is cropped from 267 to 100
2000 x 3000 100 400 Yes 267 x 400 No

Caching

Per imported account the site administrator can define caching so images will be loaded much faster in the media manager. DPMedia uses the core Joomla cache, so it can be revoked at any time in the core Maintenance Manager. Additionally the admin can define a cache time so images will downloaded after a certain time automatically again from the (S)FTP server.

(S)FTP cache

Comments (0)

We use cookies on our website. Some of them are essential for the operation of the site, while others help us to improve this site and the user experience (tracking cookies). You can decide for yourself whether you want to allow cookies or not. Please note that if you reject them, you may not be able to use all the functionalities of the site.