At this moment only the public download method is supported by webfm_popup when returning a normal download url instead of webfm id. The attached path adds support for the private download method as well by checking the chosen download method before composing the url.

I don't know if the 'system/files' settings should be hard coded or if it can be retrieved from somewhere? If this setting can be retrieved with an existing function, I should be modified in the patch.

Tom

Comments

vallab444’s picture

tom, thanks! I couldn't have changed my file download method. your patch saved me!

tom.vda’s picture

StatusFileSize
new2.87 KB

Private download will also require the implementation of hook_file_download() in the webfm module. It seems I forgot to submit this patch last time, but I already added a quick implementation of hook_file_download() which is more or less a copy of webfm_send_file().
This code code be optimized by moving the duplicate code to separate functions.

nhck’s picture

Status: Active » Needs review

Tom- thank you for submitting this patch and helping to make webfm better. I am sorry that your patch got neglected this long. I am currently reviewing this. Maybe someone else can also chime in?

nhck’s picture

Title: Support for private download method in webfm_popup » Implement hook_file_download
Version: 6.x-2.11 » 6.x-2.x-dev
StatusFileSize
new11.95 KB

A patch implementing hook_file_download can be found attached. Please test it. I don't want it to go into cvs before its not properly tested.
Changes with this patch:
+ support hook_file_download
+ move functionality of webfm_send in smaller functions: _webfm_managed_by_webfm($fullfilepath), function _webfm_attach_new_window($status = NULL), function _webfm_check_access($filepath)
- Remove hook_webfm_send
- Remove drupal_alter('webfm_file_access',

It should be possible to replace the achieved functionallity by using hook_file_download and function function _webfm_managed_by_webfm($fullfilepath)

About the patches provided: #2 is replaced by this patch. #0 should be discussed in #580556: Full support for ckeditor and tinymce through wysiwyg-api.

nhck’s picture

Status: Needs review » Fixed

I have committed this to cvs head.

Status: Fixed » Closed (fixed)

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