It seems like this module defaults to streaming files through PHP, whereas the mod_xsendfile should make this less system-intensive and hence faster.

Correct me if I'm wrong, but there is no integration with Drupal's XSend project or the PHP module directly, right? Is there a way that this could be easily implemented?

Perhaps simply modifying the file-headers to be like this?

X-Sendfile: $path_to_somefile
Content-Type: application/octet-stream
Content-Disposition: attachment; filename=\"$somefile\"

However, X-Sendfile needs to access variables ("$path_to_somefile" path and the "$somefile" filename).. So it seems like some sort of actual integration would have to be done on the maintainers' ends?

Or does this exist already somehow?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

johnhanley’s picture

I'm all for making things faster and more efficient. However, I'm inclined not to make this a huge priority given that the module currently works as described. That said, I'm willing to consider a patch that would make XSend as an option.

johnhanley’s picture

Status: Active » Postponed (maintainer needs more info)
ñull’s picture

I recently looked into the xsend module and you might be interested in the top three issues where I posted some comments that might be helpful for you.

Offlein’s picture

Thank you, ñull.. I actually have a developer who's about to finish a module that integrates Private Download (separately) with the x-sendfile plugin. We'll post it here for Bacteria Man probably tomorrow.

Sorry I hadn't mentioned anything about this.

johnhanley’s picture

@ñull,

Thanks for your interest.

@Offlein,

Thanks for your efforts regarding implementing X-Sendfile with Profile Download. I assume this will be a configurable option, which includes checking the existence of the X-Sendfile module. Will your contribution be in the form of a patch and a full modified version of the module? I'd prefer the former, which is developed with the latest 6.x-1.3 release.

John

Offlein’s picture

Bacteria Man, I'm afraid it's a broken out into an alternate module that plays with yours. That module adds a checkbox to the Private Download settings page.

FWIW, the XSend Drupal module is not required.

I've attached the module here - all work was done on contract by my awesome developer wundo. Submitted with his approval.

johnhanley’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)

@Offlein,

Thanks for posting the your customized version of Private Download. I'm sure ñull and other users will find it useful.

Cheers,
John

Offlein’s picture

You're welcome. I hope so!

Since you're marking this won't fix, though, does that mean you don't have any interest in including it as an optional module as part of the Private Download project? That'd be ideal for us I think, but we could look into creating a project page for it, separately as well.

johnhanley’s picture

does that mean you don't have any interest in including it as an optional module as part of the Private Download project?

Not necessarily. I think it makes the most sense to have one version of the module with a configurable option to use X-Sendfile. I haven't personally tested your version of the module, but I assume this is the way it works (?)

Offlein’s picture

Yes. At /admin/settings/private_download you get a new checkbox. So you have to enable the module then also check the checkbox.

My vote is to distribute it in the Private Downloads project tarball as a submodule, like how Notifications module has a bunch of submodules which you may or may not want.

johnhanley’s picture

Status: Needs review » Closed (won't fix)

Sure, I agree. Let me give it a whirl (hopefully this weekend) and report back with my impressions. Assuming everything is a go, I'll put together a new release.

Thanks again for the time (and any expense) you spent put this together.

Regards,
John

johnhanley’s picture

Status: Closed (won't fix) » Needs review
Offlein’s picture

The pleasure's all mine! Here's a newer version that addressed a few typos and other stuff. Specifically, in some PHP configurations the function apache_get_modules() will not work, so I added a check for that. If it can't detect whether you have XSend enabled, it will allow you to still turn on the module, but throw a warning. This is in private_download_xsend_enabled().

Status: Closed (won't fix) » Needs review
johnhanley’s picture

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

Closing due to Drupal 6 end-of-life cycle.