mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-18 07:23:13 +00:00
Fix archive download via API
This commit is contained in:
@@ -162,7 +162,7 @@ class DoDownloadController extends Controller
|
||||
$this->app,
|
||||
$token,
|
||||
$list,
|
||||
sprintf($this->app['tmp.download.path'].'/%s.zip', $token->getValue()) // Dest file
|
||||
sprintf('%s/%s.zip', $this->app['tmp.download.path'], $token->getValue()) // Dest file
|
||||
);
|
||||
} else {
|
||||
$list['complete'] = true;
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
@@ -7,6 +8,7 @@
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Alchemy\Phrasea\Databox;
|
||||
|
||||
interface DataboxRepository
|
||||
|
@@ -157,7 +157,7 @@ class ApiOrderController extends BaseOrderController
|
||||
}
|
||||
|
||||
$export = new \set_export($this->app, '', $basket->getId());
|
||||
$exportName = sprintf('%s.zip', $export->getExportName());
|
||||
$exportName = sprintf('%s/%s.zip', $this->app['tmp.download.path'], $export->getExportName());
|
||||
|
||||
$user = $this->getAuthenticatedUser();
|
||||
|
||||
@@ -167,12 +167,17 @@ class ApiOrderController extends BaseOrderController
|
||||
$exportData['export_name'] = $exportName;
|
||||
|
||||
$token = $this->app['manipulator.token']->createDownloadToken($user, serialize($exportData));
|
||||
$lst = [];
|
||||
|
||||
foreach ($exportData['files'] as $file) {
|
||||
$lst[] = $this->getApplicationBox()->get_collection($file['base_id'])->get_databox()->get_sbas_id() . '_' . $file['record_id'];
|
||||
}
|
||||
|
||||
$this->dispatch(
|
||||
PhraseaEvents::EXPORT_CREATE,
|
||||
new ExportEvent($user, $basket->getId(), '', $subdefs, $exportName)
|
||||
new ExportEvent($user, $basket->getId(), implode(';', $lst), $subdefs, $exportName)
|
||||
);
|
||||
|
||||
|
||||
set_time_limit(0);
|
||||
ignore_user_abort(true);
|
||||
$file = \set_export::build_zip($this->app, $token, $exportData, $exportName);
|
||||
@@ -330,7 +335,7 @@ class ApiOrderController extends BaseOrderController
|
||||
$subdefNames = [
|
||||
'document' => true,
|
||||
];
|
||||
|
||||
$this->getApplicationBox()->get_collection($file['base_id'])->get_databox()->get_sbas_id();
|
||||
foreach ($this->getApplicationBox()->get_databoxes() as $databox) {
|
||||
foreach ($databox->get_subdef_structure() as $subdefGroup) {
|
||||
/** @var \databox_subdef $subdef */
|
||||
|
Reference in New Issue
Block a user