--- 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. ```javascript var uuid = share.shareFile("user:/report.pdf", 3600); ``` ## `share.removeShare(shareUUID)` ```javascript share.removeShare(uuid); ``` ## `share.checkShareExists(shareUUID)` ```javascript if (share.checkShareExists(uuid)) sendOK(); ``` ## `share.fileIsShared(vpath)` ```javascript if (share.fileIsShared("user:/report.pdf")) sendOK(); ``` ## `share.getFileShareUUID(vpath)` ```javascript var sid = share.getFileShareUUID("user:/report.pdf"); ``` ## `share.checkSharePermission(shareUUID)` ```javascript var perm = share.checkSharePermission(uuid); ```