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