I am trying to pass an uploaded file as an argument to a python script.
form.php
<html>
<body>
<form method="post" enctype="multipart/form-data" action = "formdata.php">
<label for="file">Upload File:</label>
<input type="file" name="file" id="file" />
<label for="user_email">Email:</label>
<input type="text" name="user_email" id="user_email" />
<input type="submit" id="submit" value="Submit" />
</form>
</body>
</html>
fomrdata.php
<?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 "<pre>$output</pre>";
?>
Create.py
# 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]
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.