in reply to Re^6: INSERT file contents inside a table
in thread INSERT file contents inside a table
Try this and post the result. Be aware of the security risk of user provided data, see Calling External Commands More Safely for better solutions.
poj#!/usr/bin/perl use strict; use CGI qw(:standard); use CGI::Carp 'fatalsToBrowser' ; # only for test my $id = param('release'); my $cmd = "sudo /usr/bin/amavisd-release $id 2"; my $result; if ($id =~ /^spam-[a-zA-Z0-9-]+\.gz$/) { $result = qx/ $cmd /; } else { $result = "ERROR : Invalid id '$id'"; } print "Content-type: text/plain\n\n"; print "$cmd\n\n$result";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^8: INSERT file contents inside a table
by theravadamonk (Scribe) on Jun 07, 2018 at 05:07 UTC | |
by poj (Abbot) on Jun 07, 2018 at 06:21 UTC | |
by theravadamonk (Scribe) on Jun 07, 2018 at 11:45 UTC | |
by poj (Abbot) on Jun 07, 2018 at 12:27 UTC | |
by theravadamonk (Scribe) on Jun 08, 2018 at 17:17 UTC |