Dialog to take only the local path of a folder

Asked

Viewed 541 times

1

I have a field in an html form, where the path (path) of a Windows folder (EX: C: pasture1 pasture11) should be inserted, where this field is of the type text even.

However, to make it easier, I would like to make a dialog, equal to the input of the file type, but the intention is not to take the files, but the string with the path of the selected folder.

How should I proceed?
Thank you.

  • I believe that for security reasons it is not possible to do this, but if the intention is to choose a folder to save leave the file as normal download...

  • Actually, it’s not to save. My intention is to take the path and then work on top of that path with PHP’s Directoryiterator, for its simplicity. This script runs only on the server itself.

  • I still can’t understand exactly what you want to do and how it’s going to work

  • 1

    I think it was rather vague, but I will try to explain exactly what the script does (but I would like this improvement). Currently I access a form on localhost, where there is a field for me to indicate a folder where the files I want to work are. After submitting the form, a PHP script traverses this folder and executes an application (.exe), passing each of the folder files as parameter (one at a time). Currently all this already works, but my intention, to facilitate, is to have the possibility to choose the folder for a dialog, instead of a common text input.

  • to capture addresses you can use the request $_SERVER, to see the types as for example $_SERVER['SERVER_NAME'], make a: var_dump($_SERVER); There is also dirname(__FILE__), dirname(__DIR__). just make a echo dirname(__DIR__) that you will already see the result, for windows use PHP constant for directory separator: PATH_SEPARATOR, and to Unix: DIRECTORY_SEPARATOR.

  • 1
Show 1 more comment
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.