EPrints Technical Mailing List Archive

Message: #00472


< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First

[EP-tech] create_eprint.pl


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