Magento - 数据流错误 - 路径“path/filename.csv”不可用且无法使用
当我尝试使用数据流导出功能时,我在 Magento 中收到错误。
路径“path/filename.csv”不可用,无法使用。
此功能以前工作得很好,所以我不知道会出现什么问题。我检查了文件夹和文件的权限,它们都很好(777)。此外,我尝试删除现有文件或尝试不同的路径名,但仍然没有成功。
经过更多测试后,似乎这只发生在我亲自创建的路径上。当使用 Magento 创建的路径(例如 var/export)时,它工作得很好。
I'm receiving an error in Magento when trying to use the Dataflow export feature.
Path "path/filename.csv" is not available and cannot be used.
This feature used to work perfectly fine before, so I don't know what could be going wrong. I've checked permissions on the folder and files and they are fine (777). In addition, I've tried deleting the existing file or trying different path names and still no dice.
After some more testing, it seems that this is only occurring with a path that I have personally created. When using a path created by Magento such as var/export, it works perfectly fine.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
不需要覆盖
Mage_ImportExport_Helper_Data::getLocalValidPaths()
只需要在 self 模块中添加到 config.xml
此问题必须通过这种方式解决。
Not need override
Mage_ImportExport_Helper_Data::getLocalValidPaths()
Just need add to config.xml at self module
This issue must be resolve this way.
Afaik 这与 1.4 或 1.5 左右的一些数据流更改有关,其中 Varien 开始将
Local Server
类型的数据流配置文件限制为特定目录和文件掩码:使用 Magento 默认设置,这意味着您的导出文件必须位于
var/export
或其子文件夹之一,如“var/export/mydir/my.csv”。事实上,Magento 1.5.1 在配置文件向导中显示了适当的提示:
我只浏览了源代码,但我想要在
var/export
之外使用您自己的路径,您需要覆盖Mage_Core_Model_File_Validator_AvailablePath::isValid() 和/或覆盖
Mage_ImportExport_Helper_Data::getLocalValidPaths()
。使用符号链接会更容易(感谢@ColinM 提到这一点),但这当然只适用于允许/激活符号链接使用的系统。
Afaik this has to do with some dataflow changes around 1.4 or 1.5, where Varien started to restrict dataflow profiles for type
Local Server
to specific directory and file masks:With Magento default settings this means, that your export files must reside inside the
var/export
or one of its subfolder like `var/export/mydir/my.csv'.Magento 1.5.1 in fact shows an appropriate hint in the Profile Wizard:
I only skimmed thru the source code, but I guess to use your own paths outside
var/export
you need to overrideMage_Core_Model_File_Validator_AvailablePath::isValid()
and/or overrideMage_ImportExport_Helper_Data::getLocalValidPaths()
.More easier will be to use symlinks (thanks @ColinM for mentioning that), but this will of course only work on systems, where the usage of symlinks is allowed/activated.
从 Magento 1.4 更新到 1.7 后我遇到了这个问题。
文件名的限制更加严格。为了确保您使用正确的文件名,只需删除导出配置文件中文件名字段的内容即可。
当您保存配置文件时,Magento 将自动插入有效的文件名。
I ran into this problem after updating from Magento 1.4 to 1.7.
The filenames are more restrictive. To ensure that you use the right filename, just delete the content of the filename field in your export profile.
Magento will then automatically insert a valid filename when you save the profile.
如果您使用的是大型提供商的托管服务器,有时出于安全原因不允许使用
chmod 777
。请尝试在该文件夹上使用755
,看看是否可以解决问题。If you're on a hosted server with a large provider, sometimes
chmod 777
is not allowed for security reasons. Try755
on the folder instead and see if that fixes the issue.我把文件扩展名去掉了。我在最后添加了 .csv,一切都很好。
I had left the file extension off. I added .csv at the end and all was good.