In components/file.inc, line 275, is a call to file_directory_path() , which no longer exists in Drupal 7.
It makes Webform unusable to send attached files.

Comments

Status:Active» Postponed

Yep, D7 Webform has postponed development until D7 stabilizes.

It's in beta now, should be good to go ahead and fix. Thanks

We were in code freeze a year ago, beta doesn't mean anything other than the upgrade path now works.

Version:7.x-3.0-beta8» 7.x-3.x-dev
Status:Postponed» Needs review
StatusFileSize
new2.54 KB

This patch replaces file_directory_path with file_build_uri to get a path to the default files folder.

StatusFileSize
new1.03 KB

I filed #942974: WSOD on private file downloads as a separate issue, so I don't think webform_file_download() is worth patching here. The only other use of file_directory_path is for the field_prefix on the file component edit form. I changed that so that we're displaying the actual directory the files will go in - I think sites/mysite.com/files/webform/ will make more sense to people than public://webform/.

StatusFileSize
new1.84 KB

There is one other mention of file_directory_path in the comment of _webform_recursive_delete, so this patch includes a changed comment in addition to ksenzee's patch in #5.

This is RTBC for the part in #5, so only review needed for the comment.

Status:Needs review» Fixed
StatusFileSize
new2.46 KB

Thanks ksenzee and Stevel for the patches. I've rerolled it to remove _webform_delete_recursive() entirely, since we can now use file_unmanaged_delete_recursive() provided by core instead. Committed to HEAD.

Sorry - I removed that mention in the comment precisely because I was going to suggest nixing _webform_delete_recursive, then I forgot to say why I did it. Luckily quicksketch is way ahead of me.

Status:Fixed» Closed (fixed)

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

You Can use this in drupal 7

$files_dir = file_stream_wrapper_get_instance_by_uri('public://')->getDirectoryPath();

instead of

file_directory_path();

To get full path, please use
file_stream_wrapper_get_instance_by_uri('public://')->realpath();

Thanks for this, it works perfectly !

Thanks a lot man! I was looking for this for a while as I'm runnig single code base website.

This is a perfect example of what happens when the OOPs get hold of something. I mean, seriously; was file_directory_path() too easy?

I'm looking to move on once D8 is in circulation, (I have years of C++ so I'm completely familiar with OOP).