title: Passing an uploaded file to a python script
body: <p>I am trying to pass an uploaded file as an argument to a python script. </p>
  
  <p><strong>form.php</strong></p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;html&gt;
  &lt;body&gt;
  &lt;form method="post" enctype="multipart/form-data" action = "formdata.php"&gt;
  
  &lt;label for="file"&gt;Upload File:&lt;/label&gt;
  &lt;input type="file" name="file" id="file" /&gt;
  &lt;label for="user_email"&gt;Email:&lt;/label&gt;
  &lt;input type="text" name="user_email" id="user_email" /&gt;
  &lt;input type="submit" id="submit" value="Submit" /&gt;
  
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>fomrdata.php</strong></p>
  
  <pre class="lang-php prettyprint-override"><code>&lt;?php
  $email = $_POST['user_email'];
  $uploaded_file = //don't know what to do here
  
  $output = shell_exec("/usr/bin/python /var/www/Create.py $uploaded_file $email);
  echo "&lt;pre&gt;$output&lt;/pre&gt;";
  ?&gt;
  </code></pre>
  
  <p><strong>Create.py</strong></p>
  
  <pre class="lang-py prettyprint-override"><code>  #    def moveMetadataFile():
    #      import shutil
    #      shutil.copyfile('/var/www/**uploaded_file**', '/var/www/temp/**uploaded_file**')
    # some more code
    upload = sys.argv[1]
    email = sys.argv[2]
  </code></pre>
  
  <p>This works fine and I get the email and everything from the user and the code works if I specify a file name myself but now I want the python script to use the file that the user uploads. And I have absolutely no idea where to start?
  If it's easier to answer this ignoring the commented out part then that'll work too.</p>