Hi Rejeesh, I have just written a patch using CGI->uploadInfo. I think it does what you want. See bug 18087, patch 'Handle invalid filetypes'.
Regards, Jonathan On Tue, 14 Feb 2017 at 07:11 Rejeesh K.Nair <[email protected]> wrote: > Hi All, > > Many thanks for all your timely support , We got a solution for checking > MIME type. Here I am sharing the code snippet I have used to solve it . > Please see the code and share your comments. > > my $file = $query->param("id_list_file"); > my $tmpfilename = $query->tmpFileName($file); > my $mimeinfo = `file -i -b $tmpfilename`; > my @fields = split /;/, $mimeinfo; > my $mimetype = $fields[0]; > #print $mimetype; > if($mimetype eq 'application/marc' ){ > //Required action > }else{ > //Required action > } > > Regards, > Rejeesh > > On Wed, Feb 8, 2017 at 2:03 PM, Holger Meissner < > [email protected]> wrote: > > > Hi Rejeesh, > > > > there are a few ways to execute a system command from perl code. You can > > use > > http://perldoc.perl.org/functions/system.html > > > > Not sure if that's the best solution. > > > > Regards > > Holger > > > > Rejeesh K.Nair wrote: > > > Hi Mark, > > > > > > Your sample code meets my requirement. But I need to implement this for > > each uploading file in KOHA code. > > > > > > Regards, > > > Rejeesh K.Nair > > _______________________________________________ > > Koha mailing list http://koha-community.org > > [email protected] > > https://lists.katipo.co.nz/mailman/listinfo/koha > > > > > > -- > Thanks & Regards, > > Rejeesh K.Nair > m: +91 (0) 9495316906 <+91%2094953%2016906> > e: [email protected] > <https://www.facebook.com/rejeeshnairk> <https://twitter.com/rejeeshknair> > <http://in.linkedin.com/in/rejeeshknair> > <https://www.instagram.com/rejeeshknair/> > _______________________________________________ > Koha mailing list http://koha-community.org > [email protected] > https://lists.katipo.co.nz/mailman/listinfo/koha > _______________________________________________ Koha mailing list http://koha-community.org [email protected] https://lists.katipo.co.nz/mailman/listinfo/koha

