Some of my files are zips, and their downloads are counted for statistical purposes. Other files are icons and screenshots, the private downloading of which causes unnecessary overhead. On my site, calling system/files/* actually means a delay of several seconds while the site is bootstrapped - harmless when downloading a large file that takes longer anyway, but ugly when it slows the page load.

Adding an extra option to admin/settings/file-system and a check to file.inc#file_create_url, I have successfully added a "bypass" for certain files based on whether they match one of the entered patterns. If they're exempt, the URL will link directly to the file, otherwise it goes through system/files.

Before I clean this up for patch submission, I'd like to know if this can work at all or has been done before, etc...

Comments

g99k’s picture

Title: Allow exceptions in private download method » Please post yor patch

I don't know why no one has answered to this yet, but I'm very interested in anything that can bypass the all-or-nothing approach for private downloads in Drupal 6. Please post your patch, if you're still around.

anarcat’s picture

Title: Please post yor patch » Allow exceptions in private download method

please do not change the issue title without a good reason.

Status: Active » Closed (outdated)

Automatically closed because Drupal 6 is no longer supported. If the issue verifiably applies to later versions, please reopen with details and update the version.