Hello,
I have written a code for uploading a file onto the server.The code is as follows:
<? if ($_POST[SubmitB] == "Upload File")
{
if( move_uploaded_file ($_FILES['uploadFile'] ['tmp_name'],$target) )
{
$tmpsrc = $_FILES['uploadFile'] ['tmp_name'];
echo $tmpsrc."<br>";
sleep(5);
//$result = shell_exec\('1.sh -e mysql'\);
//fwrite\(STDOUT,$result\);
//exit\(0\);
//shell_exec\('echo $target'\);
//shell_exec\('cat $target'\);
///shell_exec\('sed -e "s/./&,/2" -e "s/./&,/28" $tmpsrc > upload/$outputfile'\);
//$cmd='sed -e "s/./&,/2" -e "s/./&,/28"';
//shell_exec\($cmd\);
shell_exec('sudo -u root -S sed -e "s/./&,/2" -e "s/./&,/28" $tmpsrc > upload/$outputfile');
//echo shell_exec("1.sh");
//echo "output =".$output."<br>";
echo "cmd =".$cmd."<br>";
echo "result =".$result."<br>";
echo "The file <a href=$target>".$_FILES['uploadedFile']['name']. "</a> has been uploaded";
\}
\}
else
\{
echo "sorry, there was a problem uploading your file.";
\}
?>
The code above is letting me upload the file onto the server, but I am
running a shell script in it, to allow me to edit that file that I have uploaded..
BUt this code is not letting me edit the file..
Is there any function that I should try ?
Please help!!!!
Thanks