Together with http://sourceforge.net/forum/message.php?msg_id=2594901 it works. I shiftet the whole file-Upload section at the end of section (3) in modify.php just before
// Build correct header message:
This works fine. It would be not a bad thing to make following options on file upload to be configurable:
1) take the original file name (like it is now default)
2) replace the filename by a numbered (like it is in the "hack" obove)
3) add the serial number to the filename (this is my solution in the moment to prevent from overwriting existing files with names like "paper.pdf" (I like my users ...)
Best regards, Volker
I'm glad to hear that your hack works and I hope that the next version of refbase will significantly improve in this area.
Extending the file upload options you proposed, I'd like to offer the admin the following options in 'ini.inc.php':
1. offer placeholders (like <original_file_name>, <original_file_extension>, <first_author>, <year>, etc) that can be used when specifying a common file re-naming scheme, e.g:
$fileName = "<record_serial>.<original_file_extension>";
or another example:
$fileName = "<first_author><year><abbrev_journal>Vol<volume>p<first_page>_<record_serial>.<original_file_extension>";
I think it's a good idea to always include the record's serial number since all other file re-naming schemes aren't really unique and may overwrite an existing file. Plus, it might be a good idea to introduce some conditional logic where the admin can specify what will happen if a given placeholder is empty. A simple way to do this would be an array specification but this may be too complicated, already...
2. allow the admin to choose whether he wants to:
- have files being always copied to the root files dir (i.e don't use any sub-directories)
- use existing sub-directories
- generate new sub-directories if required
Best regards, Matthias
I've just uploaded a modified refbase version to the CVS that supports automatic renaming of uploaded files and creation of sub-directories.
New features include:
- a flexible file naming scheme with placeholders such as <:serial:>, <:firstAuthor:>, <:year:> and many others
- this file naming scheme does also support literal text (between placeholders) as well as prefix & suffix strings (within placeholders) which will only get included if a given placeholder isn't empty
- controls for handling of any non-ASCII chars (including transliteration) and stripping of unwanted characters in file names
- regarding file location the admin can choose whether he wants to:
a) have files always copied to the root files dir (i.e don't use any sub-directories)
b) use existing sub-directories (but don't create any new ones)
c) generate new sub-directories if required
These new features may still require some testing but they seem to be working pretty well.
Wow, this is cool!
Just what I was looking for, but it doesn't seems to be implemented in the RefBase 8.0 version? (Did I miss something?) When can i expect to see this?
a release might not be too far away, but I think it's not a good idea to wait for it. I fear that there are too many uncertain variables to promise anything right now. The CVS contains a stable development version, so you could try out the CVS version. The refbase version at my institute deploys the most recent CVS version:
On the other hand, I'm a bit hesitant to recommend this CVS version since you may again be faced with some configuration trouble... E.g., currently, MySQL tables need to be added/updated manually (and as always, there's no documentation for it ;-). So you'd need to ask either me or Daniel (who already went thru this ;).
Thanks for you reply. I'm familiar with MySQL and have no problem in adding things manually. However, I am mostly concerned that those (would be) changes are relatively permanent, so that I don't need to discard the entire database when the next stable RefBase version comes out.
Also please see my posting on "open discussion" thread "Current Status?"...
PS. I can't see those features on your website, since I don't have an account there.
> Thanks for you reply. I'm familiar with MySQL and have no problem in adding
> things manually. However, I am mostly concerned that those (would be) changes
> are relatively permanent, so that I don't need to discard the entire database
> when the next stable RefBase version comes out.
No, you won't. The implemented changes are pretty much what will ship as the next release. In addition to what's in the CVS, we'll only try to provide smarter install and update scripts.
> PS. I can't see those features on your website, since I don't have an account
Yes, it was more to show you that it's successfully deployed elsewhere... ;-) Still, you can see minor new features even when not logged in, such as:
- "Show All" links on the main page
- permanent record links on the details pages
- automatically generated links to OpenURL/ISBN resolvers (the grey link icons)
- download links in citation view
In addition, users can now individually specify custom formats for "Text Citation" and generate Cite Keys on export (using a flexible naming scheme).