I added the modules File Manager and Attachment. I then decided to test it out. I checked a whole lot of permissions and enabled attachments for stories and pages. Then I created a new document and tried to attach a file. When I click the Add button, the page refreshes and at the top is a big red square with the following text in it:
* warning: fopen(private/filemanager.lck) [function.fopen]: failed to open stream: No such file or directory in /home/ahafrica/public_html/drupal/sites/default/modules/filemanager/filemanager.module on line 857.
* warning: flock(): supplied argument is not a valid stream resource in /home/ahafrica/public_html/drupal/sites/default/modules/filemanager/filemanager.module on line 858.
* warning: flock(): supplied argument is not a valid stream resource in /home/ahafrica/public_html/drupal/sites/default/modules/filemanager/filemanager.module on line 863.
* warning: fclose(): supplied argument is not a valid stream resource in /home/ahafrica/public_html/drupal/sites/default/modules/filemanager/filemanager.module on line 864.
Comments
Comment #1
cscsteve commentedThis is an error message from your system and indicates that the directory you chose to have filemanager store files in can't be accessed. Either the directory doesn't exist or your web server doesn't have appropriate permisions.
You need to:
1. Setup a directory for the files to be stored in. Set permisions so that your web server can access them.
2. In the Filemanager setup (/admin/settings/filemanager), enter the path for the relevant directories. It should warn you in this page if the directories can't be accessed.
Also: make sure you do not enable the core Upload module. Filemanager and Upload won't work together.
Good luck,
- Steve
Comment #2
ratinakage commentedThanks. Dissabling Upload module seems to have fixed the problem. :)
Comment #3
cscsteve commentedNP. Glad you got it working.
- Steve
Comment #4
scottrigbyThis may be opening an old issue, but I can not disable the Upload module because there are other modules (like the 'Ad' module) which depend on Upload.
Is there any other way to resolve this?
Thanks in advance for your help!
Scott
Comment #5
scottrigbyshould have set to active... :)
Comment #6
cindyr commentedI don't know if this is still an issue for you now, but for anyone else with this problem, here's my solution:
Drupal 5.3, Upload module disabled, Filemanager and Attachment modules enabled. My File System settings are for public download. However, you'll note it's trying to use your private folder for the lock file - same as my situation. My permissions on the private directory were rw-rw-rw-, I added the execute permissions and now I don't get that error.
I don't know what kind of security threat this poses, but since you can't access my private folder from the web and I only have one trusted individual who can upload attachments and even then not to this executable folder, I'm not concerned.
Comment #7
cscsteve commentedOk, I suppose I should have addressed the reopen post, but I didn't. So a few notes as I close this again:
1. cindyr - thanks for pointing out that the private dir needs execute permission. This is necessary in order for Drupal to create the lock files.
2. Adding this flag doesn't create a significant security threat. I know you're wondering if it means that a user can "execute" a program in the directory, and I assure you that that's not the case. An execute permission on directories simply means that a user can `cd` into that directory. You don't even need global execute on, depending on your web server setup, as setting the x bit for the proper user is sufficeient.
3. In case you're wondering why it puts it in the private directory... lock files shouldn't be downloaded by a user, and thus need to be kept away from anywhere the public can possibly see.
4. Scott - Core Upload _must_ be disabled due to a conflict. This is detailed in another bug post somewhere, search long enough for it and you'll probably find it. I'm not interested in fixing that issue at this time. If you or someone hands me a patch that goes against current CVS HEAD that fixes it, I'll be happy to check that it works and doesn't break anything and apply it.
- Steve