When I try to add an attached file, I get the following message: "File copy failed: no directory configured, or it could not be accessed. Error saving upload to filestore."
In the admin log I get the following error messages:
fclose(): supplied argument is not a valid stream resource in /home/WWW/drupal/modules/filemanager/filemanager.module on line 185.
flock(): supplied argument is not a valid stream resource in /home/WWW/drupal/modules/filemanager/filemanager.module on line 184.
flock(): supplied argument is not a valid stream resource in /home/gov/alpinecounty/WWW/drupal/modules/filemanager/filemanager.module on line 170.
fopen(private//filemanager.lck): failed to open stream: Permission denied in /home/gov/alpinecounty/WWW/drupal/modules/filemanager/filemanager.module on line 169.
I have checked that the permissions for the directories are set properly and that the directory path is correct in the filemanager settings. Access control for users has also been checked and the attachment module has been enabled in the workflow of the content settings.
Normal uploads through other Drupal modules (upload and image) work fine and store the files appropriately. I have had this module working with 4.5, so I suspect something is wrong with the 4.6/CVS version?
Either way, any help resolving this issue will be much appreciated
Comments
Comment #1
bomarmonk commentedWell, Filemanager just needed the entire path from root (even though it gave me no warnings that it couldn't find the directory or write to it): /home/myaccount/WWW/drupal/files
Comment #2
bomarmonk commentedComment #3
(not verified) commentedComment #4
xhanin commentedI have the same problem with my install of drupal 4.6. Could you please describe more your fix ?
Comment #5
bomarmonk commentedYou use filemanager with the attachment module and attachment only works if you put the full path in for your files directory, rather than a relative path.
For example, I initially had "files" listed as my file directory, which worked, except for with the attachment module.
To get attachement working I needed to have "home/drupal/WWW/files" where this path is the entire path from root to the file directory.
Hope that helps.
Comment #6
bomarmonk commentedA little more information:
In Drupal 4.6, you set this path at /admin/settings/filemanager in the field labeled "Public file system path." You also need to set the URL: http://www.mysite.com/files, for example...
Hope that helps!
Comment #7
stewcam commentedI'm still having trouble with this. The built-in upload module works fine but the attachments module keeps failing with the message:
File copy failed: no directory configured, or it could not be accessed.
Error saving upload to filestore
I'm using Drupal on a localhost setup with the following filemanager settings:
public file system path
public file system url
private file system path
Clean URLs are disabled and download method is set to private. The public file system url works fine in the browser.
I am running Drupal from D:\webserver\Apache2\htdocs with subdirectories files and private. The admin settings for filemanager automatically append anything I put in the public file system path to http://localhost/files.
Any help would be much appreciated.
Comment #8
stewcam commentedSorry, last update should include following:
public file system path = files
public file system url = http://localhost/files
private file system path = private
and the admin settings for filemanager automatically append anything I put in the public file system path to http://localhost
Comment #9
fagoi also have this problem. i can't get it going by setting the absolute path in the settings.
i also get the error "File copy failed: no directory configured, or it could not be accessed. Error saving upload to filestore." - however i get no fopen or fclose errors.
it seems that the directory, which it checks for, is an empty string !?
i tried this with drupal 4.6.2, so it this issue doesn't affect cvs only.
Comment #10
Paul Towlson commentedI have also been struggling with this one. I managed to get uploaded files accepted by putting in the full system path to my files directory (which is not web accessible, i.e. the server path itself e.g /nfs/rcs/www/webdocs/sitename/files). Then the files would appear in the files directory. However, when a user clicked on a file to open it, the path would appear as http://www.sitename/nfs/rcs/www/webdocs/sitename/files which of course could not be found.
My solution was to use the "private" option in the File system settings section on the /administer/settings page.
I would prefer to use the default http method for downloading, but 4.6 seems to have a problem with the upload module. I had no problems with 4.5 in this respect.
Is a bug fix likely on this? Or is it not actually a bug?
Comment #11
tostinni commentedFor my installation, I always use relatives path, and this work like a charm, both for private and public downloads.
Comment #12
sijuwi commentedI'm no expert but. the above problems may be related to safe mode settings on the server. It appears the filestore tries to create directories, in my case the 'working' and '0' directories, ie files/working/0. My server seems to have problems with allowing permission setting for these folders, assigned by the filestore module in drupal, under safe mode. I created these folders myself and gave them permissions and suddenly the attachment module worked.
However the url created for the page now has the wrong path, infact the directory 'working' is replaced with 'active' for some obscure reason? Furthermore when it directory '0' reaches its capacity according to the file store settings, well it tries to make another directory and fails again.
Comment #13
tostinni commentedThis is not obscure reason, this is the normal behaviour of attachment module.
First it uploads files to "working" directory and when node is validated, it moves them to "active" directory. So to solve your problem (sorry I'm not an expert about php configuration), just create these directories ("working/0" and "active/0") with correct rights, then set the settings as illimited for the capcity limits and it should works just fine.
Comment #14
ccourtne commentedCreation of these directories is normal behavior. The active and working directories are there to provide the ability to edit a node with out affect what other users see until the node is submited.
Creating the numbered directories is done for two reasons. First the directory is full per filemanagers config settings and the second is a duplicate filename. The filemanager module is capable of tracking two diferent files with the same filename (like README.txt in two different directories of the filesystem). If your php configuration is not capable of properly creating directories then filemanager and attachment modules will not work right for you.
As to the original problem of having to enter full paths to the file, I have not encountered that on any of the servers I run this module on. I will look into possible solutions as I update the module for 4.7. Marking the problem as minor as their is a work around of full paths being entered into filemanager configuration.
Comment #15
ccourtne commentedI'm marking this as fixed for now. The current head module has fixed some bugs that required the files and public directories to be inside the files driectory declared under the general files section for drupal. In addition some file not found errors would occur if the acidfree patches where applied as their was a bug in that patch that forced filemanager to look in the wrong place when promoting files.
Filemanager has to create directories to reach it's goals to manage large numbers of files. It will require an PHP setup which does this correctly.
Comment #16
(not verified) commentedComment #17
gjost commentedI did a full-scale bug hunt, tracing all the variables and such, and found out that once you got down past filemanager.module code to the file.inc code, it was looking for the destination file withing the 'file' variable.
Basically what this means is that your filemanager public and private files need to be under the file uploads directory you set on the admin/settings page.
It'd be nice if the documentation was a bit clearer on this...