Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

FolderShare REST

Security covered Under active development 7 sites

This module provides REST web services for the FolderShare module, allowing non-browser clients to manage shared files and folders. It also includes a command-line client that mimics common shell commands for interacting with shared content.


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.


Drupal 10 · not 11

Ask your assistant about FolderShare REST

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

  • FolderShare >=1.4
  • rest Drupal core
  • serialization Drupal core
  • system Drupal core >=8.7

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 PHP Release date
8.x-1.5 Stable 10 Jul 12, 2024
8.x-1.4 Stable 10 PHP 7.2 Aug 31, 2023