From c4eec014a4faec5c5ce31362332f779b05676374 Mon Sep 17 00:00:00 2001 From: DJP Date: Mon, 27 Oct 2025 13:12:25 -0400 Subject: [PATCH] Add test upload feature for direct folder testing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit New test upload panel in Upload workflow: - Upload directly to any folder ID (bypasses campaign selection) - Pre-filled with test folder: e96080ba0cd1427d253a28a87504b6665eaa02cb - Folder ID can be edited for testing different folders - Shows success/failure with full error details - Uses same upload mechanism as regular workflow Use case: - Test if specific folders allow uploads - Bypass campaign workflow for testing - Verify folder permissions - Isolate upload issues ๐Ÿค– Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- workflow_v3.php | 91 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) diff --git a/workflow_v3.php b/workflow_v3.php index 78bd6fb..dcfe391 100644 --- a/workflow_v3.php +++ b/workflow_v3.php @@ -340,6 +340,45 @@ if ($_POST && $testRunner) { $currentTab = 'upload'; break; + case 'test_upload_to_folder': + // Test upload to specific folder provided by Ferrero team + $testFolderId = $_POST['test_folder_id'] ?? 'e96080ba0cd1427d253a28a87504b6665eaa02cb'; + + if (isset($_FILES['test_upload_file'])) { + $tmpName = $_FILES['test_upload_file']['tmp_name']; + $fileName = $_FILES['test_upload_file']['name']; + $fileError = $_FILES['test_upload_file']['error']; + + if ($fileError === UPLOAD_ERR_OK) { + $apiClient = new ApiClient(); + $configV3 = new ConfigV3(); + $apiClient->setBaseUrl($configV3->getBaseUrl()); + + $oauth2Handler = new ReflectionProperty($testRunner, 'oauth2Handler'); + $oauth2Handler->setAccessible(true); + $oauth2HandlerInstance = $oauth2Handler->getValue($testRunner); + if ($oauth2HandlerInstance) { + $apiClient->setHeader('Authorization', $oauth2HandlerInstance->getAuthHeader()); + } + + $uploader = new AssetUploader($apiClient, $testFolderId); + $result = $uploader->uploadFile($tmpName, $testFolderId, [], null, $testRunner); + + $results['test_upload_result'] = $result; + $results['test_folder_id'] = $testFolderId; + + if ($result['success']) { + $success = "โœ… TEST UPLOAD SUCCESSFUL to folder {$testFolderId}!"; + } else { + $error = "Test upload failed: " . $result['error']; + } + } else { + $error = "File upload error: " . $fileError; + } + } + $currentTab = 'upload'; + break; + case 'upload_files': if (isset($_FILES['upload_files']) && isset($results['upload_folder_id'])) { // Get selected master asset lightweight data @@ -1758,6 +1797,58 @@ $envInfo = $configV3->getEnvironmentInfo(); Load campaigns with status A2 (assets sent to agency), upload processed files, and update status to A3

+ +
+

๐Ÿงช Test Upload to Specific Folder

+

+ Upload directly to a folder ID for testing (bypasses campaign workflow) +

+ +
+ + + +
+ + +
+ +
+ + +
+ + +
+ + + +
+ + โœ… TEST UPLOAD SUCCESSFUL!
+ Filename:
+ Asset ID:
+ Folder: + + โŒ Test Upload Failed:
+ HTTP Code:
+ Folder: + +
+ View API Response +
+
+ + +
+ +
+
+ +