diff --git a/app/controllers/api/storage.php b/app/controllers/api/storage.php index 10fcbdb3d3..0aac690e3c 100644 --- a/app/controllers/api/storage.php +++ b/app/controllers/api/storage.php @@ -1509,6 +1509,7 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/push') } $isInternal = $decoded['internal'] ?? false; + $disposition = $decoded['disposition'] ?? 'inline'; $dbForProject = $isInternal ? $dbForPlatform : $dbForProject; $isAPIKey = Auth::isAppUser(Authorization::getRoles()); @@ -1565,7 +1566,7 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/push') ->setContentType($contentType) ->addHeader('Content-Security-Policy', 'script-src none;') ->addHeader('X-Content-Type-Options', 'nosniff') - ->addHeader('Content-Disposition', 'inline; filename="' . $file->getAttribute('name', '') . '"') + ->addHeader('Content-Disposition', $disposition . '; filename="' . $file->getAttribute('name', '') . '"') ->addHeader('Cache-Control', 'private, max-age=3888000') // 45 days ->addHeader('X-Peak', \memory_get_peak_usage()); diff --git a/composer.json b/composer.json index 0fa5fee879..684beb870a 100644 --- a/composer.json +++ b/composer.json @@ -63,7 +63,7 @@ "utopia-php/locale": "0.8.*", "utopia-php/logger": "0.6.*", "utopia-php/messaging": "0.20.*", - "utopia-php/migration": "1.*", + "utopia-php/migration": "1.3.*", "utopia-php/orchestration": "0.9.*", "utopia-php/platform": "0.7.*", "utopia-php/pools": "0.8.*", diff --git a/composer.lock b/composer.lock index 52b5f42bc4..96a54d09c8 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "dc4eb1888275a24d596468924e272e25", + "content-hash": "1d3d4b19a835b3be79a63146fcdd389b", "packages": [ { "name": "adhocore/jwt", @@ -4456,16 +4456,16 @@ }, { "name": "utopia-php/migration", - "version": "1.4.0", + "version": "1.3.3", "source": { "type": "git", "url": "https://github.com/utopia-php/migration.git", - "reference": "18bd7d39dcee09280f40edb12879c727ecec98d3" + "reference": "731b3a963c58c30e0b2368695d57a7e8fcb7455c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/migration/zipball/18bd7d39dcee09280f40edb12879c727ecec98d3", - "reference": "18bd7d39dcee09280f40edb12879c727ecec98d3", + "url": "https://api.github.com/repos/utopia-php/migration/zipball/731b3a963c58c30e0b2368695d57a7e8fcb7455c", + "reference": "731b3a963c58c30e0b2368695d57a7e8fcb7455c", "shasum": "" }, "require": { @@ -4505,9 +4505,9 @@ ], "support": { "issues": "https://github.com/utopia-php/migration/issues", - "source": "https://github.com/utopia-php/migration/tree/1.4.0" + "source": "https://github.com/utopia-php/migration/tree/1.3.3" }, - "time": "2025-11-21T06:08:59+00:00" + "time": "2025-10-28T04:02:08+00:00" }, { "name": "utopia-php/mongo", @@ -8893,7 +8893,7 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": {}, "prefer-stable": false, "prefer-lowest": false, "platform": { @@ -8917,5 +8917,5 @@ "platform-overrides": { "php": "8.3" }, - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.6.0" } diff --git a/src/Appwrite/Platform/Workers/Migrations.php b/src/Appwrite/Platform/Workers/Migrations.php index 59cb3c5f16..e7b12c5d9d 100644 --- a/src/Appwrite/Platform/Workers/Migrations.php +++ b/src/Appwrite/Platform/Workers/Migrations.php @@ -525,6 +525,7 @@ class Migrations extends Action 'fileId' => $fileId, 'projectId' => $project->getId(), 'internal' => true, + 'disposition' => 'attachment', ]); // Generate download URL with JWT diff --git a/tests/e2e/Services/Migrations/MigrationsBase.php b/tests/e2e/Services/Migrations/MigrationsBase.php index f16864960e..490ac026b5 100644 --- a/tests/e2e/Services/Migrations/MigrationsBase.php +++ b/tests/e2e/Services/Migrations/MigrationsBase.php @@ -1315,7 +1315,7 @@ trait MigrationsBase $this->assertEquals('CSV', $response['body']['destination']); return true; - }, 30000, 500); + }, 30_000, 500); // Check that email was sent with download link $lastEmail = $this->getLastEmail();