Hi,
in a project we where working on, we wanted to use mod_secure_download to protect a subdirectory and all the files inside.
This means that mod_secure_download cannot use the full relative path after the hexadecimal timestamp, but only X number of path_elements.
The attached patch adds a new option, secdownload.path_elements (defaults to 0, so it uses the full rel_path).
An example:
secdownload.secret = "some secret"
secdownload.document-root = "/my/storage/root/"
secdownload.uri-prefix = "/safe_storage/"
secdownload.timeout = 86600
secdownload.path_elements = 2
This would allow the all the following URLs to be valid:
http://my.site/safe_storage/dcfa11fde1588d7b389229ec48a336ce/446921b1/user_id/module/
http://my.site/safe_storage/dcfa11fde1588d7b389229ec48a336ce/446921b1/user_id/module/a_file.txt
http://my.site/safe_storage/dcfa11fde1588d7b389229ec48a336ce/446921b1/user_id/module/b_file.txt
because the checksum only takes in account /user_id/module.
You could also change secdownload.path_elements to 1 and then the same URLs could be used for all URLs with the same user_id.
See comments for patch "freshness" and stability.