[EP-tech] Re: create_eprint.pl

Ulf Laube ulf.laube at ontochem.com
Wed May 2 16:11:40 BST 2012


Hi,

great! works well

Thanks a lot
Ulf

Am Mittwoch 02 Mai 2012 16:41:47 schrieb Sebastien Francois:
> Hello,
>
> This is the documentation for add_file:
>
> $doc->add_file( $file, $filename, [$preserve_path] )
>
> $file is the full path to a file to be added to the document, with
> name $filename.
>
> So try with the file's full path rather than a file handle?
>
> Seb.
>
> On 02/05/12 15:23, Ulf Laube wrote:
> > Hi all,
> >
> > I try to add a doc onto an eprint like described in the create_eprint.pl
> > example:
> >
> >         $doc_file_name = basename( $file_pdf );
> >         open $FILEHANDLER, '<', $file_pdf or die "$!";
> >         $doc = EPrints::DataObj::Document::create( $session, $eprint );
> >         $doc->set_value( "format", "application/pdf" );
> >
> >         # line 856: DEPRECATED - use L</add_file>...
> >         #$doc->upload( $FILEHANDLER, $doc_file_name );
> >
> >         $doc->add_file( $FILEHANDLER, $doc_file_name );
> >
> >         close $FILEHANDLER;
> >         $doc->set_value( "main", $doc_file_name );
> >         $doc->commit;
> >
> > But never a file will uploaded:
> >
> > [img] 	PDF
> > paper.pdf
> > Download (0b)
> >
> > What's wrong on my example?
> >
> > Thanks and best regards
> > Ulf
>
> *** 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/



-- 
OntoChem GmbH
Heinrich-Damerow-Str. 4
06120 Halle (Saale)
Germany
Tel. +49-345-478047-4
Fax: +49-345-478047-1

HRB 215461 Amtsgericht Stendal; USt-IdNr.: DE246232735


More information about the Eprints-tech mailing list