Apologies first, I'm new to drupal.org and made the mistake of posting this into the general forum yesterday.

I am having some difficulty accessing files that have been submitted using the Webform module. Specifically, these are image files. The upload process is working well as I can see that the files have been placed in the sites/default/files/webform/quotes directory.

The problem becomes apparent when I try to click on the link to the file that is included in the submission sent to my email address. The format of the link is http://mysite.com/drupal/sites/default/files/webform/quotes/image.jpg. When I try to follow the link I get a 403 'You don't have permission to access /drupal/sites/default/files/webform/quotes/image.jpg on this server' error. The same thing happens if I attempt to access the file through the webform submission results page of the site itself (even with full administrative privilages).

I can however view the file using either of the above methods if I first allow read permission for that file for all users on the server. Initially r,w,x are only set for 'owner'. Shouldn't webform be automatically allowing read permission for 'other' in order for the links that it is providing to work?

If anyone knows the cause of this problem or how I might resolve it, I would greatly appreciate it.

As an afterthought, having attachments that are sent with emails would be ideal. I am aware that this functionality is not yet available but would like to indicate my support for such a feature.

Thanks again.

Comments

quicksketch’s picture

It sounds like you might have server configuration problems. Make sure that the user Apache runs as owns the entire files directory and every directory underneath it. My guess is this happens for every file you upload on your entire site (maybe not though) try uploading a user picture or a file with Upload or FileField modules.

See this issue for files sent via attachment: #159678: Send file attachments in email

quicksketch’s picture

It looks like FileField explicitly sets uploads to 664 with @chmod($file->filepath, 0664) after uploading. We should probably consider adding such explicit chmodding to prevent problems with servers that save files with overly strict permissions.

mooky’s picture

Thanks quicksketch, I suspect you are right about it maybe being a server side problem (although files uploaded with other modules don't have this problem). I did however come across this discussion: drupal.org/node/203204. Much of it is over my head. I decided instead to take another approach using cck, triggers and actions to create and email a submission. A shame not to be able to use webform though, it's a nice module.

Cheers

quicksketch’s picture

Title: Accessing files uploaded with Webform » Accessing files uploaded with Webform (chmod files 664)
Category: support » bug
Status: Active » Fixed
StatusFileSize
new647 bytes
new761 bytes

I've committed the attached patches which chmod files 664 after uploading, to match the rest of Drupal (upload, filefield, image, etc. all do this).

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.