title: How to use file from folder in bash
body: <p>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"): </p>
  
  <p><strong>Part of upload.php:</strong></p>
  
  <pre><code>if(isset($_POST['btn-upload']))
  {                           
      $folder="/var/www/tmp/textgrid_uploads/$mid.txt";
  </code></pre>
  
  <p>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: </p>
  
  <p><strong>Part of script "conversion.sh":</strong> </p>
  
  <pre><code>mid=$1     
  infile="/var/www/tmp/textgrid_uploads/$mid"
  outfile="/var/www/tmp/mlf/${mid}.mlf"
  tmpfile="/var/www/tmp/mlf/${mid}.tmp"
  </code></pre>
  
  <p>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</p>