I use this code to upload text file to the folder. It works fine, file is in folder. File is named by multimedia id -"mid.txt"(i.e: "1.txt"):
Part of upload.php:
if(isset($_POST['btn-upload']))
{
$folder="/var/www/tmp/textgrid_uploads/$mid.txt";
I want to use the uploaded file "$mid.txt" from "textgrid_uploads" directory in script for conversion. The script "conversion.sh" has defined "input", "output" and "temporary" file because it has to be defined to store temp file:
Part of script "conversion.sh":
mid=$1
infile="/var/www/tmp/textgrid_uploads/$mid"
outfile="/var/www/tmp/mlf/${mid}.mlf"
tmpfile="/var/www/tmp/mlf/${mid}.tmp"
The script works fine, becasuse I tested it for files which were created manually on server using: vim 1.txt. Problem is when I want to use script "conversion.sh" for file which was uploaded on server using "upload.php". After using script "conversion.sh" It creates blank file called "$mid.mlf" in "mlf" directory with no text. Running of "conversion.sh": i.e: ./conversion.sh 1.txt