share.md 950 B


title: share section: share

order: 130

share.shareFile(vpath, timeoutSec)

timeoutSec=0 returns the file's existing share link (creating an "anyone with the link" share if there is none). timeoutSec>0 always creates a separate share that expires after that many seconds; the expiry survives restarts and the share is cleaned up by the nightly maintenance task.

var uuid = share.shareFile("user:/report.pdf", 3600);

share.removeShare(shareUUID)

share.removeShare(uuid);

share.checkShareExists(shareUUID)

if (share.checkShareExists(uuid)) sendOK();

share.fileIsShared(vpath)

if (share.fileIsShared("user:/report.pdf")) sendOK();

share.getFileShareUUID(vpath)

var sid = share.getFileShareUUID("user:/report.pdf");

share.checkSharePermission(shareUUID)

var perm = share.checkSharePermission(uuid);