Drupal 6 将文件存储在与安装路径位置无关的位置并通过不同的子域进行访问
我已经搜索过这个问题,但找不到干净的解决方案。我想为 Drupal 6 开发一个模块,它允许我将 /sites/default/files 目录配置为:
- 文件上传被上传到服务器上不是路径的文件夹相对于 drupal 安装路径
- 链接是通过不同的或子域公开访问的
我假设我需要挂钩几个 文件接口功能,包括file_directory_path 和 file_create_url,尽管我不确定要挂钩哪些函数。
I've searched around about this, but I can't find a clean solution. I'd like to develop a module for Drupal 6 that will allow me to have the /sites/default/files directory configured so:
- File uploads are uploaded to a folder on the server that IS NOT a path relative to the drupal install path
- Links are accessed publicly via a different or sub-domain
I'm assuming I need to hook several File interface functions including file_directory_path and file_create_url, though I'm unsure of which functions to hook.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
应该可以在 admin/settings/file-system 的文件系统设置中使用绝对路径(而不是默认的相对路径)。
显示不同的链接可能会更复杂,不知道如何在 D6 中做到这一点。我建议看看 http://drupal.org/project/cdn 或类似的模块看看他们在做什么。
It should be possible to use a absolute path (instead of the default relative one) in the file system settings at admin/settings/file-system.
Displaying a different link might be more complicated, not sure how to do that in D6. I'd suggest having a look at http://drupal.org/project/cdn or a similar module to see what they're doing.