Files
FileRise/public/api/folder/createShareFolderLink.php
T
Ryan 75f2d6de69 release(v3.5.1): authenticated Link File deep links + shared file request mode
- files(core): add internal authenticated file links (create/resolve token endpoints + ACL-checked deep-link open)
- ui(files): add Link File in row context menu + toolbar single-selection action with copy-link modal
- boot/auth: preserve fileLink return URL through login/OIDC, resolve link post-auth, focus/highlight linked file
- shares: add upload-only File Request mode for shared folders with hide-listing support and dedicated drop-zone UI
- shared-upload: add per-link validation/rate limits/quota tracking + safer relative-path handling for chunked uploads
- admin: improve shared links listing with file-request grouping and created-by/source metadata
2026-02-19 00:47:53 -05:00

53 lines
2.6 KiB
PHP

<?php
// public/api/folder/createShareFolderLink.php
/**
* @OA\Post(
* path="/api/folder/createShareFolderLink.php",
* summary="Create a share link for a folder",
* description="Requires authentication, CSRF token, and share permission. Non-admins must own the folder (unless bypass) and cannot share root.",
* operationId="createShareFolderLink",
* tags={"Shared Folders"},
* security={{"cookieAuth": {}}},
* @OA\Parameter(name="X-CSRF-Token", in="header", required=true, @OA\Schema(type="string")),
* @OA\RequestBody(
* required=true,
* @OA\JsonContent(
* required={"folder"},
* @OA\Property(property="folder", type="string", example="team/reports"),
* @OA\Property(property="expirationValue", type="integer", example=60),
* @OA\Property(property="expirationUnit", type="string", enum={"seconds","minutes","hours","days"}, example="minutes"),
* @OA\Property(property="password", type="string", example=""),
* @OA\Property(property="allowUpload", type="integer", enum={0,1}, example=0),
* @OA\Property(property="allowSubfolders", type="integer", enum={0,1}, example=0),
* @OA\Property(property="mode", type="string", enum={"browse","drop"}, example="drop"),
* @OA\Property(property="fileDrop", type="integer", enum={0,1}, example=1),
* @OA\Property(property="hideListing", type="integer", enum={0,1}, example=1),
* @OA\Property(property="preserveFolderStructure", type="integer", enum={0,1}, example=1),
* @OA\Property(property="maxFileSizeMb", type="integer", example=100),
* @OA\Property(property="allowedTypes", type="array", @OA\Items(type="string", example="pdf")),
* @OA\Property(property="dailyFileLimit", type="integer", example=250),
* @OA\Property(property="maxTotalMbPerDay", type="integer", example=2048)
* )
* ),
* @OA\Response(
* response=200,
* description="Share folder link created",
* @OA\JsonContent(
* type="object",
* @OA\Property(property="token", type="string", example="sf_abc123"),
* @OA\Property(property="link", type="string", example="/api/folder/shareFolder.php?token=sf_abc123"),
* @OA\Property(property="expires", type="integer", example=1700000000)
* )
* ),
* @OA\Response(response=400, description="Invalid input"),
* @OA\Response(response=401, description="Unauthorized"),
* @OA\Response(response=403, description="Forbidden")
* )
*/
require_once __DIR__ . '/../../../config/config.php';
$folderController = new \FileRise\Http\Controllers\FolderController();
$folderController->createShareFolderLink();