[drupal-devel] [feature] Give file uploads titles

Bèr Kessels drupal-devel at drupal.org
Mon Sep 12 10:54:49 UTC 2005


Issue status update for 
http://drupal.org/node/30775
Post a follow up: 
http://drupal.org/project/comments/add/30775

 Project:      Drupal
 Version:      cvs
 Component:    upload.module
 Category:     feature requests
 Priority:     normal
 Assigned to:  Souvent22
 Reported by:  timcn
 Updated by:   Bèr Kessels
 Status:       patch (code needs review)

"And one last question: Did you install this patch or did you just read
the description and decided that you don't need/want this
functionality?

"
Both. But if i so strongly object, I first want to have a good look,
thus I applied it and tried it, and saw no real use for it. Sorry.




Bèr Kessels



Previous comments:
------------------------------------------------------------------------

Fri, 09 Sep 2005 14:38:57 +0000 : timcn

Attachment: http://drupal.org/files/issues/upload.zip (1.33 KB)

With this patch, you can rename your file uploads. Normally, only the
file name shows up. This adds an additional input field to supply a
title for the file that is displayed instead.




------------------------------------------------------------------------

Fri, 09 Sep 2005 15:33:48 +0000 : Souvent22

Attachment: http://drupal.org/files/issues/upload_3.patch (6.37 KB)

Made a better patch in the correct format. But, this is a good patch.
DEF helps to be able to "describe" your file via a label instead of via
the filename. I hope this gets to head soon. It's the little things that
matter. :). I also made the label size larger, from 128 to 255.




------------------------------------------------------------------------

Fri, 09 Sep 2005 15:39:59 +0000 : Bèr Kessels

Hi,


please read http://drupal.org/node/22568 for how to submit patches. 


But besides that, I do not think this feature will make it into drupal.
The current upload system is aimed at simplicity. If you need a differnt
name, you should rename it locally, or use a contributed file managing
module. But that is just my opinion. Others might like it!




------------------------------------------------------------------------

Fri, 09 Sep 2005 18:39:15 +0000 : Boris Mann

It's a good idea. Does it make sense to have filename --> filepath
mapping as part of the file API? I would certainly say that that should
be part of the information stored (i.e. there is a column for "name" in
the table), but it would be up to modules to implement this.




------------------------------------------------------------------------

Fri, 09 Sep 2005 19:25:57 +0000 : drumm

I don't see a way to edit the description.




------------------------------------------------------------------------

Fri, 09 Sep 2005 21:25:36 +0000 : Souvent22

Yes, if you go to the node, and you edit the node, you can edit the
descriptions of the attachments.




------------------------------------------------------------------------

Sun, 11 Sep 2005 20:07:29 +0000 : m3avrck

Ber, in contrast, this patch doesn't make uploads anymore complex,
rather provides some much needed functionality. When a file is uploaded
right now, it's name is whatever the name of the document is plus
extension... which as we know how file names are, can sometimes be
quite unreadable. How many people are going to take the time to rename
the file? Not too many people I've noticed (I deal with a client that
has 100s of files, filenames is a *big* issue).


So all this patch does introduce a field to put a name for the file,
makes 100% sense and I think this is *much* needed.


Tested patch, works great.


However, the title field (drumm where did you get description??? this
is only a title field) should have a default value initially after the
upload and this should be set to the filename, as that is how Drupal
works currently. Then, if the user chooses, they can change the display
name of the file, otherwise the default will be the filename, not
breaking nor interfering with how Drupal currently handles files. Very
smooth transition :)


Also, getting a small 'fuzzy' problem when appyling patch on line 404,
please check and reroll clean patch against head, thanks!




------------------------------------------------------------------------

Mon, 12 Sep 2005 06:03:17 +0000 : Goba

+1 on the functionality. We still use a custom file upload module on one
of our sites, since the upload module allows no title (which we use as a
caption) to be associated with an upload.




------------------------------------------------------------------------

Mon, 12 Sep 2005 07:49:12 +0000 : timcn

"However, the title field (drumm where did you get description??? this
is only a title field) should have a default value initially after the
upload and this should be set to the filename, as that is how Drupal
works currently.

"
First, I had this kind of functionality but I removed it because there
could be a redudancy in the database. Now, if the title-field is empty,
the module uses the filename. If it is not empty, thus contains a
string, it uses the string. If you leave the field empty (the default
setting), the filename is *automatically* used.




------------------------------------------------------------------------

Mon, 12 Sep 2005 08:45:18 +0000 : timcn

Attachment: http://drupal.org/files/issues/uplodad.patch (6.38 KB)

Hope this patch is better. I tried the patch from Souvent22 and patch
said the following:


patching file database/database.mysql
patching file database/database.pgsql
patching file database/updates.inc
patching file modules/upload.module
patch unexpectedly ends in middle of line
Hunk #6 succeeded at 404 with fuzz 1.
The new patch runs without this fuzziness.




------------------------------------------------------------------------

Mon, 12 Sep 2005 09:12:17 +0000 : Bèr Kessels

I fail to see any need for this. Thus I -1 on this. Can we not rather
improve the filenaming on the file.inc level?
I like the simplicity of the current upload module a lot, and I fear
this will only add clutter for nearly all people using this module.
Tose taht need advanced file tools, should use an advanced module IMO. 


And last, but not least, i've looked all file handling mechanisms I
know, last days, and not one has a filed to change the name. I checked
gmail, gmx, squirrelmail, ccmixter, mp3.com (alikes) etc.


So I stick with my -1 ,for IMO it only adds clutter yet I cannot see
anyone using it.


What about a joint effort to get a single good advanced-uplaod.module
from the ground? One that takes te best of all the alternatives around
in a single project? And offers features like file renaming etc.




------------------------------------------------------------------------

Mon, 12 Sep 2005 10:20:38 +0000 : timcn

"Can we not rather improve the filenaming on the file.inc level?
I like the simplicity of the current upload module a lot, and I fear
this will only add clutter for nearly all people using this module.
Tose taht need advanced file tools, should use an advanced module IMO.

"
First of all, I think improving the filenaming is not a very good
solution and I doubt that it's simpler than just adding a title field
for every file. You would also have to provide a proper file name for
every file but the disadvantage is that you still have the file
extension (i.e. *.pdf).


"And last, but not least, i've looked all file handling mechanisms I
know, last days, and not one has a filed to change the name. I checked
gmail, gmx, squirrelmail, ccmixter, mp3.com (alikes) etc.

"
Well, that would be an argument against file renaming on file.inc-level
- not against giving files a title. The reason why e-mail services do
not provide an option to change the /title/ of a file is, that there is
no possibility to transmit this title while sending an e-mail.


"So I stick with my -1 ,for IMO it only adds clutter yet I cannot see
anyone using it.

"
Well, in this thread are already some people who appreciate a
functionality like this (Souvent22, Boris Mann, m3avrck, Goba and of
course me). As m3avrck said, this patch does not complicate or clutter
anything.


"What about a joint effort to get a single good advanced-uplaod.module
from the ground? One that takes te best of all the alternatives around
in a single project? And offers features like file renaming etc.

"
Again, I do not think that this is a good idea. I really think there is
a need for titling files for almost every user. Also, my solution does
not complicate anything if you don't want to give your files a title -
just leave the title field blank and the filename is used
automatically.


And one last question: Did you install this patch or did you just read
the description and decided that you don't need/want this
functionality?







More information about the drupal-devel mailing list