send blob ok

This commit is contained in:
isUnknown 2024-10-10 16:58:34 +02:00
parent 8c19269e48
commit ef2eeafa8d
20 changed files with 171 additions and 221 deletions

View file

@ -1,17 +0,0 @@
Description: nouvelle description
----
Tags: matériaux & textures
----
Date: 2024-10-09 05:10
----
Uuid: vs4tgLg5q6QFeb43
----
Template: image

View file

@ -1,17 +0,0 @@
Date: 2024-10-09 05:10
----
Description:
----
Tags:
----
Uuid: Nlkd6hX666PBBYlk
----
Template: image

View file

@ -1,17 +0,0 @@
Date: 2024-10-09 05:10
----
Description:
----
Tags:
----
Uuid: UkFMsBPXVGpQMmXV
----
Template: image

View file

@ -1,17 +0,0 @@
Date: 2024-10-09 05:10
----
Description:
----
Tags:
----
Uuid: DknJcJ7YnG29JXUN
----
Template: image

View file

@ -1,17 +0,0 @@
Date: 2024-10-09 05:10
----
Description:
----
Tags:
----
Uuid: zGisP0BopebPl2ex
----
Template: image

View file

@ -1,17 +0,0 @@
Date: 2024-10-09 05:10
----
Description:
----
Tags:
----
Uuid: 2Nt5Vv2SrGcE1iro
----
Template: image

View file

@ -1,17 +0,0 @@
Date: 2024-10-09 05:10
----
Description:
----
Tags:
----
Uuid: ih7KMM6KjNoQ2umR
----
Template: image

View file

@ -10,19 +10,11 @@ Clientbriefpdf:
----
Description: test
Description: description
----
Clientbriefimages:
- file://DknJcJ7YnG29JXUN
- file://Nlkd6hX666PBBYlk
- file://zGisP0BopebPl2ex
- file://ih7KMM6KjNoQ2umR
- file://UkFMsBPXVGpQMmXV
- file://2Nt5Vv2SrGcE1iro
- file://vs4tgLg5q6QFeb43
Clientbriefimages:
----

View file

@ -4,14 +4,30 @@ return [
'pattern' => 'upload-images.json',
'method' => 'POST',
'action' => function () {
if ($uploads = kirby()->request()->files()) {
$pageUri = kirby()->request()->query()->get('pageUri');
$page = page($pageUri);
throw new Exception(json_encode($_FILES), 1);
$kirby = kirby();
$request = $kirby->request();
$files = $request->files();
$data = $request->data();
throw new Exception(json_encode([
'files' => $files,
'data' => $data,
]));
$pageUri = $request->query()->get('pageUri');
$page = page($pageUri);
if ($uploads = $request->files()) {
$allFiles = $page->clientBriefImages()->toFiles()->pluck('uuid', ',');
$alerts = [];
throw new Exception(json_encode($uploads), 1);
foreach ($uploads->get('images') as $upload) {
// check for duplicate
$files = $page->files();