Default standard file upload name

Oghnia - July 7, 2008 - 16:03
Project:FileField
Version:5.x-2.3
Component:Miscellaneous
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed
Description

Hi everybody,,,

is it possible to get the file name to be set to default (as I want to call the uploaded pdf file called "factsheet") instead of re-naming it..
now if that is not possible then how can we get a direct link to the file without the description (the file name and such)

I think I confused the hell out of everybody,,

thanks anyway :)

#1

jpetso - July 7, 2008 - 18:55

Setting a default file name (or rather, description) is not possible currently, not sure if it's a good idea to have such a thing.

What you could do with the current code in filefield 5.x-2.x is to have custom theming for the theme_filefield() function - e.g., copy it to your theme's template.php (renaming theme_filefield() to phptemplate_filefield()) and replace $desc = $file['description']; with $desc = 'factsheet';. Easy.

What you could do with the current code in filefield 6.x-1.x-beta2 is provide a custom formatter that takes the default filefield generic formatter and just replaces the description with your "factsheet" label. See filefield_imagecache (in the filefield_image project) for how to create a minimal formatter - yours is probably even more minimal as it doesn't provide any settings whatsoever.

I can well imagine that an option for default descriptions might solve at least two issues in one stroke, and combined with a widget that locks the file description it would provide a nice solution. I'm however on my way out and shouldn't take on many more tasks at this point, so that is something that someone else will have to write.

Does that answer your question? If so, please close the bug with status "fixed".

#2

Oghnia - July 8, 2008 - 18:55
Status:active» fixed

Thanks for your answer.

as for a fix I figured it out,, just a way of going around and doing it really fast,, thanks for the help anyway... :)

#3

Anonymous (not verified) - July 23, 2008 - 10:57
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.