We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2ad94ff commit f16d3edCopy full SHA for f16d3ed
controller/upload_file.rst
@@ -247,6 +247,11 @@ logic to a separate service::
247
248
return $fileName;
249
}
250
+
251
+ public function getTargetDir()
252
+ {
253
+ return $this->targetDir;
254
+ }
255
256
257
Then, define a service for this class:
@@ -447,9 +452,13 @@ controller.
447
452
{
448
453
$entity = $args->getEntity();
449
454
455
+ if (!$entity instanceof Product) {
456
+ return;
457
458
450
459
$fileName = $entity->getBrochure();
451
460
- $entity->setBrochure(new File($this->targetPath.'/'.$fileName));
461
+ $entity->setBrochure(new File($this->uploader->getTargetDir().'/'.$fileName));
462
463
464
0 commit comments