Needs review
Project:
Upload path
Version:
5.x-1.1
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
17 Sep 2008 at 18:57 UTC
Updated:
4 Mar 2009 at 14:18 UTC
Currently there's only one option for cleaning filenames: "Clean file upload filenames", which does everything or nothing.
It would be great to be able to control the individual processing functions of this (for example, sanitize paths without adding a unique id).
I've attached a patch that does the above, and a screenshot of the revised "Misc" pane.
Additionally I wrapped uniqid() in md5() for addtional entropy (because uniqid() often has identical leading characters, since it's time-seeded).
| Comment | File | Size | Author |
|---|---|---|---|
| uploadpath-misc-settings-patch.png | 131.15 KB | smokris | |
| uploadpaths-misc-settings-patch.png | 131.15 KB | smokris | |
| uploadpath-misc-settings.patch | 9.68 KB | smokris |
Comments
Comment #1
davidwhthomas commentedHi,
Thanks for your interest in the clean filenames feature.
It's main purpose is to make the filename reflect the file context on the site.
That is, to use the node title or file description for the filename
To that extent, the current functionality could be extended to allow a filter for mimetypes / file extensions to exclude from renaming.
Other than that, the current processing is required to create sanitized filenames in the first place and shouldn't be optional.
The Drupal6 version uses
uniqid(rand(), true)for added entropy in the appended code.
In any case, feel free to modify your local install for your needs.
DT
Comment #2
giorgio79 commentedThanks for this patch.
I was just looking to permit longer filenames than 60 characters because currently the maximum total length is 60 characters.I am using Drupal 6 version, hope the patch works there too.
Comment #3
bartezz commentedThanks for the patch, finding it very usefull to have some more control over what this module does!
Cheers
Comment #4
jr8279 commentedCan we get this patch for D6?