0

I created a content type with 4 fields on it:

  1. Private Image Field
  2. Public Image Field
  3. Private File Field
  4. Public File Field

I am able to access 1 and 2, as they are image fields. But if I upload an image to the normal file field, then I get access denied when I try to access it.

I tried imlementing hook_file_download but it's not even triggering it for a normal file field.

What could I be missing?

UPDATE

I checked the file_managed table and the uri field has this:

private://p\DIY-flip-table-computer-desk_0.jpg

When I changed it to this:

private://p/DIY-flip-table-computer-desk_0.jpg

It worked!

Any idea why my Drupal would be saving the file like this?

UPDATE 2

The problem might be related to the filefield paths module. I even updated it to the latest dev version, but no luck. The only workaround I could find was to leave out the "file path" value. So that it wont add the file to the folder "p". I can at least carry on now, but it would've been great if it could work with folders as it is intended to.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.