0

İ have a code like this but this code runs as a server side and gets 1000 file names max. How can i run this code with javascript to convert this process in a client side any ideas? Note: I need an array with names to use on PHP again.

<?php
if ( empty($_POST['folder']))
{
    ?>
    <form method="POST">
        <div class="container compare_body">
            <div class="row">
                <div class="col-md-3">
                    Pick a folder:
                </div>
                <div class="col-md-3">
                    <input type="file" name="folder[]" webkitdirectory directory multiple/>
                </div>

                <div class="col-md-3">
                    <button type="submit" class="btn btn-info">Get Results</button>
                </div>
            </div>
        </div>
    </form>
    <?php
}
else
{
    $names=$_POST['folder'];
    print_r($names);
}
?>
  • Do you want to report files on your server back to the browser or report files on the clients PC – RiggsFolly May 14 '16 at 14:46
  • PS The code you show ___does not do anything with files___ – RiggsFolly May 14 '16 at 14:48
  • So you want access to the files on a client's PC from a browser window? Is that it? – RST May 14 '16 at 14:50
  • 1
    If that was possible then I could write a web site to look at all files the files on your PC. _Would you mind if I looked at all your files_. So ___obviously its not possible___ javascript will not let you reach that far out of the sandbox – RiggsFolly May 14 '16 at 14:50
  • Opinions seem to differ a lot in this old but from time to time updated sort of similar topic http://stackoverflow.com/questions/371875/local-file-access-with-javascript – RST May 14 '16 at 14:55

0 Answers0