EPrints Technical Mailing List Archive

Message: #00474


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

[EP-tech] Re: create_eprint.pl


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