Hello,
I have a problem when I want to upload a private file with a webform. The file is uploaded in the private directory ("private") but not in the webform directory ("private/webform"). In the mail, the file link is not valid.
Do you have a solution to fix this problem?
Thank you.
Issue fork webform-1976810
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #1
quicksketchI haven't experienced this problem. Could you describe the configuration of your file component (which directory you've specified it should upload into), and what link you get in the e-mail? What's the actual URL it should be?
Comment #2
fredfab commentedI think I can reproduce this behavior with the private path.
This is the configuration of my file component :
When I upload a file (ex: 001.jpg) with my webform file component, webform module create the folder "webform/mywebformname/files" in my drupal private directory.
Everythings looks perfect... but :
The email link is :
http://www.example.com/system/files/webform/mywebformname/files/001.jpg
This behavior seems strange but in fact this path this only accessible by authorized roles, so I think we can consider that is a private path and close this issue.
Comment #3
quicksketchYep, this is the expected behavior. If you use private files, you must be logged in to view them. I could see that being an issue for users where you send them a receipt e-mail. They should be able to view the files they themselves uploaded. We could solve this problem similar to how we made submissions accessible to anonymous users. Give the file a hash and append it to the URL. This "secret hash" would allow anyone to view the file. I'm moving this to a feature request.
Comment #4
danchadwick commentedClosing for lack of activity and small use case. It would also imply creating a different URL than the usual one so that the private system URL wouldn't be used.