Open/Browse Dialog box in php/javascript?

You can use file uploading forms with html and send the form to your PHP file to handle the file contents. When a file is sent to the server it is stored in a temporary location.

W3Schools has a good tutorial on this, the HTML becomes:

<html>
<body>

<form action="upload_file.php" method="post"
enctype="multipart/form-data">
<label for="file">Filename:</label>
<input type="file" name="file" id="file"><br>
<input type="submit" name="submit" value="Submit">
</form>

</body>
</html>

and the PHP:

<?php
if ($_FILES["file"]["error"] > 0)
  {
  echo "Error: " . $_FILES["file"]["error"] . "<br>";
  }
else
  {
  echo "Upload: " . $_FILES["file"]["name"] . "<br>";
  echo "Type: " . $_FILES["file"]["type"] . "<br>";
  echo "Size: " . ($_FILES["file"]["size"] / 1024) . " kB<br>";
  echo "Stored in: " . $_FILES["file"]["tmp_name"];
  }
?>

http://www.w3schools.com/php/php_file_upload.asp


You can put a form element by using <input type="file">

If you only want the path without uploading the file. You can use javascript.

If you post the data to the server file's info will be available to PHP but also the file will be sent to server as well.

Check the Javascript File Api examples here if you want more .. http://www.html5rocks.com/en/tutorials/file/dndfiles/