[TikiWiki-commits] [Git][tikiwiki/tiki][28.x] [BP][ENH] Tiki API: Add support for uploading new versions of files

"Bruno Kambere \(@kambereBr\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <6895f8f9b9e1e_2c107064c4446@gitlab-sidekiq-low-urgency-cpu-bound-v2-78c9dd4f58-8nd7r.mail>

Bruno Kambere pushed to branch 28.x at Tiki Wiki CMS Groupware / Tiki


Commits:
3b8b7854 by Bruno Kambere at 2025-08-08T16:10:58+03:00
[BP][ENH] Tiki API: Add support for uploading new versions of files
---
* [BP][ENH] Tiki API: Add support for uploading new versions of files
---
* [ENH] Tiki API: Add support for uploading new versions of files
---
* [ENH] Tiki API: Add support for uploading new versions of files

See merge request tikiwiki/tiki!8049

See merge request tikiwiki/tiki!8235

See merge request tikiwiki/tiki!8236

- - - - -


2 changed files:

- lib/core/Services/File/Controller.php
- templates/api/docs/paths/galleries/upload.yaml


Changes:

=====================================
lib/core/Services/File/Controller.php
=====================================
@@ -95,7 +95,13 @@ class Services_File_Controller
         }
 
         $gal_info = $this->checkTargetGallery($input);
-        $fileId = $input->update->int() ? $input->fileId->int() : false;
+
+        if (($input->update->int() || $input->upload->int()) && $input->fileId->int()) {
+            $fileId = $input->fileId->int();
+        } else {
+            $fileId = false;
+        }
+
         $asuser = $input->user->text();
         $title = $input->title->text();
         $description = $input->description->text() ?: '';


=====================================
templates/api/docs/paths/galleries/upload.yaml
=====================================
@@ -13,6 +13,9 @@ post:
             galleryId:
               type: integer
               description: The gallery ID where the file will be uploaded
+            fileId:
+              type: integer
+              description: The file ID to update. Provide this to upload a new version and replace the current file. If omitted, a new file will be created instead.
             data:
               type: file
               description: file path to upload



View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/3b8b7854211baca5b175b80a25fe9965be441379

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/3b8b7854211baca5b175b80a25fe9965be441379
You're receiving this email because of your account on gitlab.com.

_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.