When using private downloads, viewing the default image only yields a 404 error page instead of the image. That's because hook_file_download() doesn't feel responsible for that file (it's not in the {files} table, after all) and neither does any other module.

Possible solutions:

  • Store the default image in the {files} table, and delete it when the default image or the field is being deleted.
  • Do the same thing in a separate {imagefield_default_images} table, and handle that in imagefield_file_download().
  • Store the image in a predefined directory (e.g. files/imagefield_default_images) and let imagefield_file_download() access all files in there. (hm... security?)

Comments

dopry’s picture

Status: Active » Fixed

this is fixed in head, rev 1.30.2.6.2.51

I chose fixed names and locations for default images that can be used in hook_file_download...
I bypass the access check for files without nid's in hook_file_download... still have conflicts with
upload.module.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.