addFileShare(file, user, access, [message]) Last updated: 03. Aug 2025
API only function
Creates a new share / overwrites existing for a specific file and user, and sends an invitation email to the specified user.
Parameters
Name | Type | Description |
---|---|---|
file | string | Absolute path to file to create a new share for |
user | string (email) | Email for user. |
access | string | A string with letters describing the access level: R - read (read in Docly and on websites) M - modify (W also allowed) - requires R V - Visit (web site read access only "Visit") Example: "RM" meaning read and modify |
message (optional) | string | Optional message to send to user |
Returns
Returns true for success or throws an error.
Example
Code example (JS)
JS is normal JavaScript either running in the browser or on the Docly™ server.docly.addFileShare("test file", "test@docly.net", "V", "Access granted to view file", "Here is the file");