getUploadDir example

$this->updateAssociations();

            // Create album thumbnails             $this->createAlbumThumbnails($this->album);
        }

        // Name changed? Then rename the file and set the new path         if ($isNameChanged) {
            $mediaService = Shopware()->Container()->get(MediaServiceInterface::class);
            $newName = $this->getFileName();
            $newPath = $this->getUploadDir() . $newName;

            // Rename the file             $mediaService->rename($this->path, $newPath);

            $newPath = str_replace(Shopware()->DocPath(), '', $newPath);

            // Set the new path to save it.             $this->path = $newPath;
        }
    }

    
Home | Imprint | This part of the site doesn't use cookies.