[EP-tech] create_eprint.pl

Ulf Laube ulf.laube at ontochem.com
Wed May 2 15:23:29 BST 2012


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
-- 
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