php 后端的 magento 中缺少图片上传按钮
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/15022532/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
image upload buttons are missing in magento in back end
提问by prasadmsvs
I am new to Magento...Installed 1.7 community Edition.
I have heard great deal about it and so far I was not impressed..anyway I am trying to add imagesto a Productbut 'Browse files' and 'Upload' buttons are missingfrom the backend.
I have tried several solutions from online like:
-copying 'media' folder from 'adminhtml' folder to 'frontend',
-clearing caches,
-reforming indices,
-upgrading to latest flash player.
Nothing seems to work. If any one found solution to this problem please let me know.
我是 Magento 的新手...安装了 1.7 社区版。
我听说了很多关于它的事情,到目前为止我没有留下深刻的印象。无论如何,我正在尝试将图像添加到产品,但后端缺少“浏览文件”和“上传”按钮。
我已经尝试了多种在线解决方案,例如:
-将“媒体”文件夹从“adminhtml”文件夹复制到“前端”、-
清除缓存、-
重新形成索引、-
升级到最新的 Flash 播放器。
似乎没有任何效果。如果有人找到了解决此问题的方法,请告诉我。
回答by Neeraj Garg
These buttons are coming from flash.So check your media folder on following location
这些按钮来自 flash.So 在以下位置检查您的媒体文件夹
design/adminhtml/default/default/template/media
if there is no media folder then copy from fresh magento
如果没有媒体文件夹,则从新的 magento 复制
This will solve your problem :)
这将解决您的问题:)
回答by Suman
Magento image uploading issue is related to flash. You need to change the settings of your browser. If you are using chrome,
Magento 图片上传问题与 flash 相关。您需要更改浏览器的设置。如果您使用的是铬,
- Go chrome settings, or by typing chrome://settings/content
- Go to Content settings => flash
- Turn on Allow site to run flash
- Turn off ask first
- 转到 chrome 设置,或输入 chrome://settings/content
- 转到内容设置 => flash
- 打开允许站点运行闪存
- 先关闭询问
And in Firefox, you don't need to do anything, if your flash player is outdated, you need to update it
而在 Firefox 中,你不需要做任何事情,如果你的 Flash Player 已经过时了,你需要更新它
回答by Akash lal
Go to chrome://settings/content/flash Add you website url in allow tag
转到 chrome://settings/content/flash 在允许标签中添加您的网站网址
Then refresh your admin panel
然后刷新您的管理面板
回答by Pawel Dubiel
if git is used It's also a good to check .gitignore. it's easy to ignore "media/" instead of "/media/". Deeper media directory contains swf upload buttons.
如果使用 git 检查 .gitignore 也不错。很容易忽略“media/”而不是“/media/”。更深的媒体目录包含 swf 上传按钮。
回答by Grégory Salmon
The upload button is not displayed if JavaScript Variables maxUploadFileSizeInBytesand maxUploadFileSizeare not properly configured in the following files:
如果 JavaScript 变量maxUploadFileSizeInBytes和maxUploadFileSize在以下文件中未正确配置,则不会显示上传按钮 :
- /app/design/adminhtml/default/default/template/media/uploader.phtml
- /app/design/adminhtml/default/default/template/media/cms/browser/content/uploader.phtml
- /app/design/adminhtml/default/default/template/media/uploader.phtml
- /app/design/adminhtml/default/default/template/media/cms/browser/content/uploader.phtml
The variables are declared as follows:
变量声明如下:
maxUploadFileSizeInBytes = <?php echo $this->getDataMaxSizeInBytes() ?>;
maxUploadFileSize = '<?php echo $this->getDataMaxSize() ?>';
You can directly edit:
您可以直接编辑:
maxUploadFileSizeInBytes = 10485760; /* 10.48576 MB */
maxUploadFileSize = '104857600';
The getDataMaxSizeInBytes()and getDataMaxSize()are defined in the file:
所述getDataMaxSizeInBytes()和getDataMaxSize()是在文件中定义:
- /app/code/core/Mage/Adminhtml/Block/Media/Uploader.php
- /app/code/core/Mage/Adminhtml/Block/Media/Uploader.php
If your server is running with HHVM, the parameters PHP post_max_sizeand upload_max_filesizeare available under the names hhvm.server.max_post_sizeand hhvm.server.upload.upload_max_file_size.
如果您的服务器使用HHVM运行,则参数 PHP post_max_size和upload_max_filesize在名称hhvm.server.max_post_size和hhvm.server.upload.upload_max_file_size下可用。
For this he will have to modify the appeal of these parameters in the php file Uploader.php, here's how:
为此,他必须在 php 文件Uploader.php 中修改这些参数的吸引力,方法如下:
Copy the file in the Local Uploader.php architecture:
复制Local Uploader.php架构中的文件:
- /app/code/local/Mage/Adminhtml/Block/Media/Uploader.php
- /app/code/local/Mage/Adminhtml/Block/Media/Uploader.php
replace the following lines:
替换以下几行:
public function getPostMaxSize()
{
return ini_get('post_max_size');
}
public function getUploadMaxSize()
{
return ini_get('upload_max_filesize');
}
by the following:
通过以下方式:
public function getPostMaxSize()
{
$post_max_size = ini_get('post_max_size');
return $post_max_size ? $post_max_size : ini_get('hhvm.server.max_post_size');
}
public function getUploadMaxSize()
{
$upload_max_filesize = ini_get('upload_max_filesize');
return $upload_max_filesize ? $upload_max_filesize : ini_get('hhvm.server.upload.upload_max_file_size');
}
Cordially. G
亲切。G
回答by Vishal Thakur
I found this issue in admin area. First Enable the Flash of Browser then Recheck.
我在管理区发现了这个问题。首先启用浏览器的Flash,然后重新检查。
These buttons use FLASH.
这些按钮使用 FLASH。
So if your browser does not support flash - then they will not appear.
因此,如果您的浏览器不支持 Flash - 那么它们将不会出现。
Ensure that the app/design/adminhtml/default/default/template/mediafolder exists and that there are 2 files within it.
确保该app/design/adminhtml/default/default/template/media文件夹存在并且其中有 2 个文件。
- editor.phtml
- uploader.phtml
- 编辑器.phtml
- 上传者.phtml
Ensure that the skin/adminhtml/default/default/mediafolder exists and that there are 3 files within it.
确保该skin/adminhtml/default/default/media文件夹存在并且其中有 3 个文件。
- flex.swf
- uploader.swf
- uploaderSingle.swf
- flex.swf
- 上传者.swf
- 上传者Single.swf
If you have created your own theme (ie Theme: "mytheme" and Package "mypackage") then ensure the above applies for:
如果您创建了自己的主题(即主题:“mytheme”和包“mypackage”),请确保以上内容适用于:
app/design/adminhtml/mytheme/mypackage/template/mediaskin/adminhtml/mytheme/mypackage/media
app/design/adminhtml/mytheme/mypackage/template/mediaskin/adminhtml/mytheme/mypackage/media
I hope this helps.
我希望这有帮助。
回答by Noor Alvi
I had the same issue and sorted by doing the following settings in Google Chrome:
我遇到了同样的问题,并通过在 Google Chrome 中进行以下设置进行排序:
Go to menu in the right corner > settings > Advanced > Privacy and Security > Content Settings > Flash > In the allow section click 'ADD' button and type your website URL.
转到右上角的菜单 > 设置 > 高级 > 隐私和安全 > 内容设置 > Flash > 在允许部分单击“添加”按钮并输入您的网站 URL。
You can check the following URL if any problem: http://www.alvipixels.co.uk/blog/magento-product-image-upload-button-not-showing.php
如果有任何问题,您可以查看以下 URL:http: //www.alvipixels.co.uk/blog/magento-product-image-upload-button-not-showing.php
回答by Jan
I had this problem after emptying all my caches in Opera. I just added the exception of my site to the flash setting. Just make sure it is the complete url starting with http(s). I one case I opened the flash player properies and first deleted all content using the delete all button on the advanced tab.
清空 Opera 中的所有缓存后,我遇到了这个问题。我只是将我的网站的例外添加到 Flash 设置中。只需确保它是以 http(s) 开头的完整 url。在一个案例中,我打开了 Flash Player 属性,并首先使用高级选项卡上的全部删除按钮删除了所有内容。
If it is working in one browser it is usually NOT a magento code error in another browser.
如果它在一个浏览器中工作,它通常不是另一个浏览器中的 magento 代码错误。
回答by Luca Pasqualotto
I had problem updating to magento 1.9.1, the problem was solved by copying the folder /app/design/adminhtml/default/default/template/dull
我在更新到 magento 1.9.1 时遇到问题,通过复制文件夹 /app/design/adminhtml/default/default/template/dull 解决了问题
into the new magento instance.
进入新的 magento 实例。
回答by Amit Naraniwal
Image upload button is a flash button so you have to download Flash Player. You can download flash player from following link : http://get.adobe.com/flashplayer/otherversions/
图片上传按钮是一个 Flash 按钮,因此您必须下载 Flash Player。您可以从以下链接下载 Flash Player:http: //get.adobe.com/flashplayer/otherversions/
After installing flash player just need to restart your browser, now you can see the image upload button.
安装完flash player后只需要重启浏览器,就可以看到图片上传按钮了。

