The module works great.. when not using path!
All files that are uploaded in a subdirectory created by FileField Paths cannot be accessed, being subbject to the famous Apache Forbidden You don't have permission to access.
When removing any Path directions (everything uploaded in /files, access is OK
The same for core Upload module and FielField.
What am I missing?
Comments
Comment #1
decipheredHi jvielle,
Can you provide me with a little more information so I can best determine the issue?
What pattern are you using in the path field?
What is the path of the files that can not be accessed?
Is this on local server or hosted? If hosted, by whom?
As I have never witnessed this particular issue before, any information you can provide me with will be appreciated.
Cheers,
Deciphered
Comment #2
jvieille commentedThank you very much for your fast follow up
I used the following pattern
[type]/[bookpath]
This created the following directories
knowledge_module/00 Introduction
The rejected access path is
http://www.controlchaingroup.fr/sites/default/files/knowledge_module/00%...
Drupal is hosted on a dedicated server under my own administration
I think you may have hit it: the spaces in directory names might mess things up.
UPDATE:
I just made a check removing the space. Now, the link appears like this
http://www.controlchaingroup.fr/sites/default/files/knowledge_module/00_...
Same problem
Comment #3
decipheredIt is possible that the space is the issue, I will attempt to reproduce that to confirm.
I would suggest testing an upload with another pattern, say 'node/[nid]' and see if the files uploaded to that directory are accessible.
Also, you can use Pathauto to cleanup the directories/files by turning it on under the cleanup options in the FileField Paths configuration, that should allow you to remove the spaces and test if that improves things.
Cheers,
Deciphered.
Comment #4
jvieille commentedI did what you suggest.
As mentionned earlier, removing the spaces did not had an effect
I tried the suggested path which gives the folllowing http access
http://www.controlchaingroup.fr/sites/default/files/node/92/CCM00-00_01_...
Still denied
Comment #5
decipheredHave you tried with any other file/filetype?
The other possibility, I have seen something like this before where something happens to the .htaccess file in the files directory, if you delete (or move) it it will recreate itself, can't remember exactly how, and that fixed that particular problem. Don't know if this is the exact same issue, but it's worth a shot.
Comment #6
jvieille commentedI tried with a doc file - same
there is an .htaccess file in the File directory. It contains the followinh
SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006
Options None
Options +FollowSymLinks
I tried to delete it - same behaviour.
Comment #7
jvieille commentedI made several tests.
files uploaded by other modules (Webfm for example) in subdirectories are accessible.
Only those uploaded in subdirectories since I installed FileField Paths are unaccessible.
Resulting of the upload in ccm/[boookpath], the file permission are :
file/ccm : 744
file/ccm/00_Introduction: 744
file/ccm/00_Introduction/CCM00-00_01_INTRO_OVW_en.pptx: 664 - Cannot access this file
By comparison, an upload by Webfm gives something a little bit different
file/webfm : 775
file/webfm/ccm : 775
file/webfm/ccm/00 Introduction : 755
file/webfm/ccm/00 Introduction/00-00_INTRO_OVW : 755
file/webfm/ccm/00 Introduction/00-00_INTRO_OVW/CCM00-00_01_INTRO_OVW_en.pptx : 644 - Can access this file
If I change the permission settings to 775 for the directories, it works!
Comment #8
decipheredHi jvieille,
FileField Paths uses Drupals API functions file_create_path and file_move to manipulate the filesystem. As the manipulation of the filesystem is the core behaviour of this module, were this a major bug in the code I would have experienced it before and/or have many issues relating to it in my issue queue.
I know this may sound like I'm passing the buck, but it sounds to me like it's something to do with your server configuration.
Things I would suggest testing at this stage would be running a simple php snippet with one of the functions listed above to see what result it has to your filesystem. Try running file_move() on a file (already in your drupal filesystem) that has 755 permissions and see what happens to the file.
The other thing, what are the permissions of the files before you upload?
I really do want to help you solve this issue, but when it is something that I can not reproduce no matter how hard or how much I try, it does make it difficult.
Cheers,
Deciphered.
Comment #9
jvieille commentedThank you very much for your time trying to help me.
I agee that such a big issue would have been reported.
You can be sure it has nothing to do with your module, I just tried Upload Path, and got the same issue.
I'll do some investigation on my server.
Thanks a lot
Comment #10
decipheredHi jvieille,
I would still be very interested in what information you do find so that if the issue ever does occur for someone else I can point them to this post to solve their issue.
Best of luck,
Deciphered.
Comment #12
jrosen commentedI am also using the Path Settings to create a custom path named "sample_images". When the folder was created, the permissions were set to 700. I had to manually modify to 755 to get past the Apache Forbidden message.
If anyone figures this out, it would be great.