So I created this small little JavaScript snipplet that will do the trick. It inserts the information from the file type textfield into a hidden type textfieild so you can parse the information from the $_POST array.
Code: Select all
<script language="javascript">
function pathgrabber()
{
var pathInfo = document.getElementById('file').value;
document.getElementById('pathtofile').value = pathInfo;
}
</script>
<form action="upload.php" method="post" enctype="multipart/form-data" name="form1">
Location of the file to upload:<br>
<input name="file" type="file" size="75">
<input name="pathtofile" type="hidden" id="pathtofile">
<br>
<input type="submit" name="Submit" value="Submit" onClick="pathgrabber()">
</form>Handle page:
Code: Select all
<?php
if ( isset ($_POST['Submit']) && isset ($_FILES['file']) )
{
echo '<pre>';
print_r ($_POST); // will display contents of array
echo '</pre>';
}
?>Enjoy.