17 lines
471 B
PHP
17 lines
471 B
PHP
<?php
|
|
namespace Stemcell\ProductImport\Plugin;
|
|
|
|
class UploaderPlugin
|
|
{
|
|
public function beforeSave(
|
|
\Magento\Framework\File\Uploader $subject,
|
|
$destinationFolder,
|
|
$newFileName = null
|
|
) {
|
|
// 添加更多允许的扩展名
|
|
$allowedExtensions = ['jpg', 'jpeg', 'gif', 'png', 'webp', 'bmp', 'tiff'];
|
|
$subject->setAllowedExtensions($allowedExtensions);
|
|
|
|
return [$destinationFolder, $newFileName];
|
|
}
|
|
}
|