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
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
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
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
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
Yes. It's the storing of the default string for that user that necessitates the wait for v4.2
Hi Mark,
here's an admin script that does this attachment renaming.
Cheers
Stephan
Last edit: Stephan Matthiesen 2013-02-15
Excellent Stephan,
I've uploaded this to files here.
Mark
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
Re-opened as a reminder to revisit for v4.2.
Reminder to self, ensure MESSAGES.php has explanation of default filename usage.
Mark