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

Command icon 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

quicksketch’s picture

I 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?

fredfab’s picture

I think I can reproduce this behavior with the private path.

This is the configuration of my file component :

  • Distination : private
  • Directory : webform/mywebformname/files

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.

quicksketch’s picture

Title: Private files + downloads » Allow private files to be accessed by anonymous users (through link in the e-mail)
Category: bug » feature
Priority: Major » Normal

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.

Yep, 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.

danchadwick’s picture

Issue summary: View changes
Status: Active » Closed (won't fix)

Closing 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.

saravanaprasanth made their first commit to this issue’s fork.