[TikiWiki-commits] [Git][tikiwiki/tiki][29.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 <6895f0647c546_2c11d8a48954a3@gitlab-sidekiq-low-urgency-cpu-bound-v2-78c9dd4f58-rrp5t.mail>

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


Commits:
2d70dd04 by Bruno Kambere at 2025-08-08T15:33:10+03:00
[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

- - - - -


2 changed files:

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


Changes:

=====================================
lib/core/Services/File/Controller.php
=====================================
@@ -102,7 +102,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;
+        }
+
         if (! empty($input->asArray('user')) && is_array($input->user->asArray())) {
             $asuser = $input->asArray('user')[0];
         }


=====================================
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/2d70dd04fee8235b6aa6c590beefc30d85909eee

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/2d70dd04fee8235b6aa6c590beefc30d85909eee
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.