4 # script to upload a picture to a borrowerimages directory.
5 # checks to see if its either displaying the upload form
6 # or doing the actual upload.
7 # written by Waylon Robertson (genjimoto@sourceforge) 2005/08/22
10 # Copyright 2000-2002 Katipo Communications
12 # This file is part of Koha.
14 # Koha is free software; you can redistribute it and/or modify it under the
15 # terms of the GNU General Public License as published by the Free Software
16 # Foundation; either version 2 of the License, or (at your option) any later
19 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
20 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
21 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
23 # You should have received a copy of the GNU General Public License along with
24 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
25 # Suite 330, Boston, MA 02111-1307 USA
35 my $name = $input->param('name');
36 my $borrowernumber = $input->param('borrowernumber');
37 my $photo = $input->param('photo');
40 my $htdocs = C4
::Context
->config('intrahtdocs');
41 my $upload_dir = $htdocs."/borrowerimages";
43 $template_name = "members/member-picupload.tmpl";
45 $template_name = "members/moremember.tmpl";
48 my ($template, $loggedinuser, $cookie)
49 = get_template_and_user
({template_name
=> $template_name,
53 flagsrequired
=> {borrowers
=> 1},
58 my $filename=$borrowernumber.'.jpg';
59 my $upload_filehandle = $input->upload("photo");
60 open UPLOADFILE
, ">$upload_dir/$filename";
62 while ( <$upload_filehandle> )
70 borrowernumber
=> $borrowernumber,
73 output_html_with_http_headers
$input, $cookie, $template->output;
75 print $input->redirect("http://intranet/cgi-bin/koha/members/moremember.pl?borrowernumber=$borrowernumber");