File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -413,7 +413,7 @@ For files with `secureDownload: true` or when you need controlled access:
413413** Get file token:**
414414
415415```
416- POST /attachment/download/get-file-token.json
416+ POST /attachment/download/get-file-token
417417Body: { "file": "<attachment_id>" }
418418Response: { "token": "<jwt_token>" }
419419```
@@ -433,7 +433,7 @@ GET /attachment/download/stream/<token>
433433** Get ZIP token for multiple files:**
434434
435435```
436- POST /attachment/download/get-zip-token.json
436+ POST /attachment/download/get-zip-token
437437Body: { "files": ["<id1>", "<id2>", ...] }
438438Response: { "token": "<jwt_token>" }
439439```
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ public function getZipToken()
1414 if (!$ this ->getRequest ()->is ('post ' )) throw new BadRequestException ('Post Needed ' );
1515 if (empty ($ this ->getRequest ()->getData ('files ' ))) $ this ->set ('token ' , '' );
1616 else $ this ->set ('token ' , (new Token )->encode (['files ' => $ this ->getRequest ()->getData ('files ' )]));
17+ $ this ->viewBuilder ()->setClassName ('Json ' );
1718 $ this ->viewBuilder ()->setOption ('serialize ' , ['token ' ]);
1819 }
1920 // (new Token)->encode(['files' => [$attachment1->id, $attachment2->id]])
@@ -39,6 +40,7 @@ public function getFileToken()
3940 if (!$ this ->getRequest ()->is ('post ' )) throw new BadRequestException ('Post Needed ' );
4041 if (empty ($ this ->getRequest ()->getData ('file ' ))) $ this ->set ('token ' , '' );
4142 else $ this ->set ('token ' , (new Token )->encode (['file ' => $ this ->getRequest ()->getData ('file ' )]));
43+ $ this ->viewBuilder ()->setClassName ('Json ' );
4244 $ this ->viewBuilder ()->setOption ('serialize ' , ['token ' ]);
4345 }
4446 // (new Token)->encode(['file' => $attachment->id])
You can’t perform that action at this time.
0 commit comments