Similar to SMTP library: Allow for custom filename conversion backend: e.g. to clean filename from i18n characters.

For me, it is always a problem to require from users to upload files with filenames that contain alphanumeric characters (without those special Hungarian characters like: éáíűúő).

In the new version of drupal, we should allow developers to develope a module without patching the Drupal core, to be able to make filename conversion. E.g: cleaning up filename from i18n characters, spaces, etc...

What are your opinions about it?

CommentFileSizeAuthor
upload_23.patch988 byteskeve

Comments

gábor hojtsy’s picture

The SMTP api loads in a big mail sending backend. Now why do we need a separate include file for a single function to clean up chars in uploads? Why don't we simply look for a callback or hook which should be defined? Having a variable for an include file, including that include file and calling one single function on there seems to be overkill to me.

keve’s picture

Thanks for comment.

First of all, do you, guys, think this is important enough to include it into core? Did you have any problem with it?

I wrote the code this way, since the majority of drupal users will not use it. I thought, for them it is faster, to check a variable, than calling a hook.

1. Should i make it with a new hook, which is called by module_invoke_all?
Does it have any chance to get into core?

2. By setting a variable, (checked in the filename conversion module), controlling that in which module should it look for a given function.

Any suggestion, which is faster for general users?

drewish’s picture

i think something like this would fit in with the changes that i want to make after #115267 gets committed. dopry and have done a little preliminary stuff on a hook_file so modules could have a say in the file handing. this request is similar to what people want for the image module to sort image files by user or that sort of thing. if you've got a hook that passes out a copy of the file object you could move it.

keve’s picture

Status: Needs work » Closed (fixed)

Thank you for pointing me out. :)

Hook_file would definitely solve this. I will continue to watch http://drupal.org/node/142995 .
I close this issue.

gábor hojtsy’s picture

Status: Closed (fixed) » Closed (duplicate)

Mark this a duplicate then.