Score:0

Private File Permissions Not Working for a Single file - Can't Identify where to find error

rs flag

I have the following set up:

  • Private file field configured on content type
  • Access control configured with referenced user having permission to view file
  • If user is referenced on the node, they can view the private file of that node.

Here is the issue that I am having:

  • A specific file could not be loaded. Drupal Redirects as if the user does not have proper permissions to view the file.
  • Other files, with an identical setup work fine
  • If I download the file, rename it and re-upload to a new node, it works
  • If I download the file, rename it and then re-upload on the original node it works

So, I have an intermittent issue where a tiny subset of files are not able to viewed by the user. What could possibly cause a single node/file combo to fail as described above?

Score:0
cn flag

I suspect the problem is in the symbols of the file name. Probably, when PHP do the file_exists - it may get false because the file is not 'visible'. Try this https://www.drupal.org/project/transliterate_filenames or similar modules to transliterate the filenames during the uploads.

See more here File name transliteration

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.