|
View:
New views
3 Messages
—
Rating Filter:
Alert me
|
|
|
something wrong with wp_unique_filename()I was messing with wp_handle_upload()
(http://phpxref.com/xref/wordpress/wp-admin/includes/file.php.source.html#l207) recently (trying to use it for my own uploads). It has a built-in support for error generating and file naming operations override (kinda twisted one). Or so it looks. Error reporting is ok. Unique file name generation override seems wrong. Here is the code: http://phpxref.com/xref/wordpress/wp-includes/functions.php.source.html#l1883 Function takes optional argument - $unique_filename_callback, that should point (if it is supplied) to the user-defined unique name generating function. Now the problem is that default logic flow has access to filename extension and callback doesn't. Hence it's impossible to generate unique filename with proper extension manually. Has anyone ever used this function? -- David Barbakadze _______________________________________________ wp-hackers mailing list wp-hackers@... http://lists.automattic.com/mailman/listinfo/wp-hackers |
|
|
Re: something wrong with wp_unique_filename()On Wed, Jun 17, 2009 at 6:42 AM, Davit Barbakadze<jayarjo@...> wrote:
> I was messing with wp_handle_upload() > (http://phpxref.com/xref/wordpress/wp-admin/includes/file.php.source.html#l207) > recently (trying to use it for my own uploads). It has a built-in > support for error generating and file naming operations override > (kinda twisted one). Or so it looks. Error reporting is ok. Unique > file name generation override seems wrong. > > Here is the code: > http://phpxref.com/xref/wordpress/wp-includes/functions.php.source.html#l1883 > > Function takes optional argument - $unique_filename_callback, that > should point (if it is supplied) to the user-defined unique name > generating function. Now the problem is that default logic flow has > access to filename extension and callback doesn't. Hence it's > impossible to generate unique filename with proper extension manually. > > Has anyone ever used this function? I'm guessing not since that is definitely not useful behavior. We can try passing the extension as a third argument. _______________________________________________ wp-hackers mailing list wp-hackers@... http://lists.automattic.com/mailman/listinfo/wp-hackers |
|
|
Re: something wrong with wp_unique_filename()Ryan, that would be helpful.
On Wed, Jun 17, 2009 at 9:01 PM, Ryan Boren <ryan@...> wrote: > On Wed, Jun 17, 2009 at 6:42 AM, Davit Barbakadze<jayarjo@...> > wrote: > > I was messing with wp_handle_upload() > > ( > http://phpxref.com/xref/wordpress/wp-admin/includes/file.php.source.html#l207 > ) > > recently (trying to use it for my own uploads). It has a built-in > > support for error generating and file naming operations override > > (kinda twisted one). Or so it looks. Error reporting is ok. Unique > > file name generation override seems wrong. > > > > Here is the code: > > > http://phpxref.com/xref/wordpress/wp-includes/functions.php.source.html#l1883 > > > > Function takes optional argument - $unique_filename_callback, that > > should point (if it is supplied) to the user-defined unique name > > generating function. Now the problem is that default logic flow has > > access to filename extension and callback doesn't. Hence it's > > impossible to generate unique filename with proper extension manually. > > > > Has anyone ever used this function? > > I'm guessing not since that is definitely not useful behavior. We can > try passing the extension as a third argument. > _______________________________________________ > wp-hackers mailing list > wp-hackers@... > http://lists.automattic.com/mailman/listinfo/wp-hackers > -- David Barbakadze _______________________________________________ wp-hackers mailing list wp-hackers@... http://lists.automattic.com/mailman/listinfo/wp-hackers |
| Free embeddable forum powered by Nabble | Forum Help |