Hello,
I've created a content type with filefield and tried to upload some file with it. File was successfully uploaded, but when I tried to open file using web browser, I have got an 403 error.
I noticed, that uploaded file has 600 rights, thus file can be read only by it's owner. I don't know how I can force filefield to automatically set chmod to 644, to make file readable by everyone.
I don't know if there is something wrongly set or if there is some bug in a module code.
Is there any way to fix it?
Thanks for answer in advance.
Comments
Comment #1
TailsCZ commentedComment #2
dopry commentedWhat is php's umask on your server? are you using private or public file handling? Are you using any other upload capable modules?
Comment #3
amitaibuHaving the same issue when file system is set to private and not using any other upload module.
Comment #4
TailsCZ commentedI Googled and executed this script:
It returned 22. I don't know if it's right, because I don't understand it very well (yet).
I'm using public file handling and I'm not using any other upload modules.
Comment #5
damjan.cvetan commentedI have the same issue. If I select "public" option under Download method everything is just fine. But selecting Private option makes the url link of the uploaded file unknown.Drupal returns:
Page not found
The requested page could not be found.
Comment #6
dopry commented@damjanC, a 404 is not a 403. Don't dilute the 403 issue, open your own. You also cannot change the public/private files setting after you site has been setup without completely thrashing your file handling..
@TailsCZ, hmm the umask seems correct.. did you run this from command line to get the 0022 or via the web server? There are different php.ini files for php ran from the CLI and via apache...
Comment #7
dopry commentedis this resolved by http://drupal.org/node/293977?
Comment #8
TailsCZ commenteddopry: I've created a php file with that script above, uploaded it on server via FTP and opened in web browser.
EDIT: I can't use command line, because my Drupal webpage is running on freehosting, not my own server.
I read somewhere, that file permissions could be set by chmod() in PHP script. Is this possible in filefield module?
EDIT2: I Updated Drupal to 6.4 and Filefield to alpha2, but problem still remains.
Comment #9
adampasz commentedI'm experiencing a similar problem with the module, in conjunction with imagefield. Since upgrading to Drupal 6.4, admin users are no longer able to upload or remove images. They get a 403 error.
Oddly, the superuser is still able to upload and remove without getting an error.
Here is what the URL looks like that's getting the 403:
/drupal/filefield/ahah/[content_type]/[field_name]/1
Everything worked fine under Drupal 6.3.
I'm using FileField 6.x-3.0-alpha3 and ImageField 6.x-3.0-alpha1
Comment #10
amitaibu@adampasz,
This is a different issue, probably this - #297035: HTTP error 0
Comment #11
TailsCZ commentedHello. I consulted this problem also with webhosting admin and he said that umask is set to give 600 permissions to files due to security reasons, but permissions can be changed manually with chmod for example. Is this possible in filefield to set my own file permissions?
I'll ask otherwise: Is possible to add option "file permission" into filefield? I mean that in filefield settings will be something where I can define required file permissions and filefield applies them to uploaded file.
Comment #12
drewish commentedi think this is really a core issue: #203204: Uploaded files have the permissions set to 600