Drupal 6将文件存储在非相对于安装路径位置并通过不同的子域进行访问

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.

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.