Menu

#6 Rename attachments automatically to standard name

None
open
nobody
v4.2 (7)
5
2013-02-15
2013-02-01
No

Hello Mark,

another suggestion (not really important but would be a time-saver): It should be possible to define a default filename in the settings. So when you upload an attachment, you have an option to rename it automatically.

For example, I like to name my PDFs with the scheme Author_2013_First_few words_of_the_title.pdf

The papers downloaded from journal websites have often cryptic names like s45709823654.pdf, so I always have to retype the title (or copy and then replace all spaces with underscores).

I understand that internally Wikindx saves attachments with the hash as filename, so in some sense it doesn't matter really. But when you download a paper again for local use, it's just much easier if they all have a readable name of the same form and not the cryptic original name.

What I suggest is:

  • in the settings, have a field where users can define a default filename, with some place holders, like "$A_$Y_$T(100c).$E" (Author, Year, 100chars of title, file extension). Should be user-definable as others want perhaps to include journal name. Also have the option to replace spaces in the resulting filename with other chars ("_") (I try to avoid spaces as not all devices handle them well, but others may want them).

  • in the file upload dialogie, next to the existing file name field, there is a button "use default filename" and when you click on it, the file name field is filled with that default name. So you can decide at upload time if you want to use the default, the original or something completely different.

  • in the attachment edit dialogue, where you can rename files, have the same button to insert the default name.

Cheers
Stephan

Discussion

  • Mark Grimshaw

    Mark Grimshaw - 2013-02-01

    Good idea Stephan but, as it involves settings and therefore a new database field, I'll leave this until a v4.2 release rather than these current small incremental releases.

    Mark

     
  • Stephan Matthiesen

    Hi Mark,

    Understandable, no problem. In the meantime I can probably write a small script for myself that changes the name in the database, should be doable with a few simple SQL calls. That's the beauty of Wikindx that I actually have control over my data!

    Cheers
    Stephan

     
  • Mark Grimshaw

    Mark Grimshaw - 2013-02-01

    Reminder to self. . .

    On the other hand, not all attachments are the paper referred to by the resource and there can be multiple attachments/resource. So, your system, while it makes sense to use the author, title and publication year for the displayed and database filename, the code should also append something like ...#1, ...#2 etc. to differentiate between files. NB, the author title, year come from the resource not from the attached file.

    Mark

     
    • Stephan Matthiesen

      Hi Mark, good point, additional number is useful and important.

      As you say, the attachment might not be the paper, so it should also still be possible to set the filename manually and let user decide if they want the default or not.

      You'd probably have to pass the default string to the file attachment dialogue, but this should be possible as the file dialogue is called from the resource view where that info is available, isn't it?

      Cheers
      Stephan

       
      • Mark Grimshaw

        Mark Grimshaw - 2013-02-01

        Yes. It's the storing of the default string for that user that necessitates the wait for v4.2

         
  • Mark Grimshaw

    Mark Grimshaw - 2013-02-01
    • labels: --> v4.2
    • milestone: -->
     
  • Stephan Matthiesen

    Hi Mark,

    here's an admin script that does this attachment renaming.

    Cheers
    Stephan

     

    Last edit: Stephan Matthiesen 2013-02-15
  • Mark Grimshaw

    Mark Grimshaw - 2013-02-15

    Excellent Stephan,

    I've uploaded this to files here.

    Mark

     
  • Mark Grimshaw

    Mark Grimshaw - 2013-02-15
    • status: open --> closed
     
  • Stephan Matthiesen

    Hi Mark, thanks for uploading the script. Do you think it's worth keeping the feature request open, though? It would still be useful to have some default naming option in the core programme in some future release, as not everybody will want to handle scripts.

    Cheers
    Stephan

     
  • Mark Grimshaw

    Mark Grimshaw - 2013-02-15
    • status: closed --> open
     
  • Mark Grimshaw

    Mark Grimshaw - 2013-02-15

    Re-opened as a reminder to revisit for v4.2.

    Reminder to self, ensure MESSAGES.php has explanation of default filename usage.

    Mark

     

Log in to post a comment.