I have installed the module and am getting green confirmation messages from all of the configuration settings under Site Config | Private Upload, so I think things are generally correctly configured.

However, I am receiving the message below when I try to access a file as an authenticated user with permissions on the node where the file is attached. Seems like something isn't configured right.

Forbidden

You don't have permission to access /sites/default/files/private/Tip Sheet 4 Interview Prep for TV_1.pdf on this server

--------------------------------------------------------------------------------
Apache/2.2.9 (Fedora) Server at staging.xxxx-011.xxxxx.com Port 80

Comments

vuzzbox’s picture

Priority: Critical » Minor
Status: Active » Closed (fixed)

I figured this out. It might be helpful for someone else to know what was happening.

I am using a content template to present file access. In the template, I was pulling the $file->filepath value from the node. By default, this was pointing to the /sites/default/files/private/Tip Sheet 4 Interview Prep for TV_1.pdf path referenced above. Of course, that path behaves as it should and blocks access.

I did an str_replace on the path so that it was pointing to /system/files/private/Tip Sheet 4 Interview Prep for TV_1.pdf instead and it all works as designed.

morthylla’s picture

Thank you! Your solution worked as a charm!

beckyjohnson’s picture

Can you give me an example of your str_replace? I am having this same issue.
This is my code on my template

 <?php if (!$logged_in): ?>
          <?php echo"To access this additional content, you must be a member.
Please sign up. It's quick, it's free, it's easy!"?>
          <?php print drupal_get_form("user_login") ?>
          <?php echo 'If you are not a member please sign up.'; ?>
          <?php print drupal_get_form('user_register'); ?>
         <?php else: ?>
      <?php print $content ?>
           <?php endif; ?>

Just to add, if i am logged out, I can use this form and log in and get the file. If I am already logged in, then I get a forbidden error.