[EP-tech] Re: How to rename a file uploaded by a user automatically
Dimitrakakis Georgios
giorgis at lib.uoc.gr
Wed Dec 12 14:57:51 GMT 2012
Thx Volker!
I didn't have to look into it yet...
I will try your suggestion as soon as possible and let you know!
Best,
G.
> Tim, thank's a lot for the hint.
>
> The following now works for us, although it should be probably
> localized as described in
> http://wiki.eprints.org/w/Instructions_for_local_plugins
>
> In perl_lib/EPrints/Plugin/Screen/EPrint/UploadMethod.pm we added 2
> lines to the sub class "action_add_format".
>
> if( $filename =~ /^[A-Z]:/i )
> {
> $filename =~ s/^.*\\//;
> }
> else
> {
> $filename =~ s/^.*\///;
> }
> my $eprintid = $self->{processor}->{eprint}->get_value( "eprintid"
> ); #added
> $filename =~
> s/.+?\.([^.]*$|$)/new_first_part_of_the_filename_$eprintid\.$1/;
> #added
>
> Georgios, I hope it's also useful for you.
>
> Best,
> Volker
>
> --
> Volker Schallehn
>
> Ludwig-Maximilians-Universität München
> Universitätsbibliothek
> Referat Elektronisches Publizieren
>
> Geschwister-Scholl-Platz 1, 80539 München, Germany
>
>
>
> -----Original Message-----
> From: eprints-tech-bounces at ecs.soton.ac.uk
> [mailto:eprints-tech-bounces at ecs.soton.ac.uk] On Behalf Of Tim Brody
> Sent: Tuesday, December 11, 2012 4:43 PM
> To: eprints-tech at ecs.soton.ac.uk
> Subject: [EP-tech] Re: How to rename a file uploaded by a user automatically
>
> On Thu, 2012-12-06 at 19:32 +0200, Dimitrakakis Georgios wrote:
>> I am very interested in this as well!
>>
>> So, if somebody has any idea please share...
>>
>> Best,
>>
>> G.
>>
>> > Hi all,
>> >
>> > Does anyone know how to rename a file uploaded by a user
>> > automatically? And in addition the eprintid should be a part of the
>> > renamed filename. It's EPrints 3.3.10
>
> Hi,
>
> EPrints doesn't support this. If you wanted to modify the core you would
> need to look in:
> perl_lib/EPrints/Plugin/Screen/EPrint/UploadMethod.pm
>
> And its sub-classes.
>
> --
> All the best,
> Tim.
>
> *** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
> *** Archive: http://www.eprints.org/tech.php/
> *** EPrints community wiki: http://wiki.eprints.org/
>
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
More information about the Eprints-tech
mailing list