Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: MCP Sentinel 2.29.0 — Minor update available for module mcp_sentinel (2.29.0). Release: Audit Chain 1.10.9 — Minor update available for module audit_chain (1.10.9). Release: Menu Autopilot 1.4.7 — Minor update available for module menu_autopilot (1.4.7). Release: FileGate 1.11.3 — Minor update available for module file_gate (1.11.3). Release: Download Tracker 1.0.7 — Minor update available for module download_tracker (1.0.7). Release: Directory2Block Slideshow 1.0.8 — Minor update available for module directory2block_slideshow (1.0.8). Release: Mautic Audiences 1.1.5 — Minor update available for module mautic_audiences (1.1.5). Release: Rightup theme 1.0.3 — Minor update available for theme vartheme_bs5_rightup (1.0.3). Module Revived: Swagger-PHP OpenAPI 3 documentation generator 1.0.0 — Module swagger_php updated after 10 months of inactivity (1.0.0). Security Coverage: Microsoft Azure AI — Module ai_provider_azure now has official Drupal security advisory coverage.


This module provides REST web services for the FolderShare module. This enables users to use non-browser client applications to upload, download, create, delete, and modify shared files and folders managed by FolderShare.

Uses

While a web browser provides interactive access to a web site, REST web services enable automatic scripted access as well as alternate client applications that may present customized user interfaces. For instance, the included command-line REST client provides a shell-like interface and Linux/BSD/macOS-style commands to access shared files (e.g. "ls", "cp", "rm"). This command-line client can be used interactively, or embedded in shell scripts that compute or process data and automatically post results to a web site.

Demo

View sample command line interaction

Requirements

  1. Drupal 10.2.x
  2. PHP 8.2.x
  3. FolderShare module

FolderShare REST client

The "client" subdirectory in this module contains a PHP command-line client named "foldershare" that uses REST connections to access FolderShare files. This script may be distributed to a site's users.

FolderShare REST client requirements

The client requires:

  • A recent version of PHP available on the user's host.
  • A site REST configuration with JSON or JSON+HAL serialization enabled. XML serialization is not supported.
  • A site with standard cookie-based authentication.

FolderShare REST client usage

From a terminal window, help is available:

./foldershare --help
To connect to a site, the site's name must be given using the "--host" option. Login credentials may be given using "--username" and "--password" options. The rest of the command line provides a REST command to execute, such as "ls".

./foldershare --host MYHOST --username MYNAME --password MYPASSWORD ls
If a user name is provided, but no password, the user will be prompted for the password. If a user name is not provided, the user will access the site anonymously, just as they would by using a web browser without logging into the site.

If no REST command is given, the script will enter an interactive mode that prompts for commands.

./foldershare --host MYHOST

Many Linux/BSD/macOS-style commands are supported, such as:

  • 'cp' to copy a file or folder.
  • 'hostname' to get the name of the remote host.
  • 'ls' to list a folder's contents.
  • 'mkdir' to create an empty folder.
  • 'mv' to move or rename a file or folder.
  • 'rm' to remove a file or folder.
  • 'rmdir' to remove an empty folder.
  • 'stat' to get file or folder attributes.
  • 'whoami' to get the user's name.
  • 'xattr' to get extended file attributes.

Many Linux/BSD/macOS-style command options are also supported. For instance, "ls -l" gives a long folder listing and "rm -r" deletes a folder tree recursively. To get help on a command, add the "--help" option (e.g. "ls --help").

Several custom commands are supported, such as:

'download' to download files and folders.
'update' to change attributes of a file or folder.
'upload' to upload files and folders.

Acknowledgements

Developed by the San Diego Supercomputer Center (SDSC) at the University of California at San Diego (UCSD) and funded by the National Science Foundation (NSF) under Grant No. 1443083.


Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
2
Tracked since
Aug 2023
Latest release
2 years ago
Releases (12 mo)
0
Maintenance
Slowing

Releases

Version Type Core Release date
8.x-1.5 Stable Jul 12, 2024
8.x-1.4 Stable Aug 31, 2023