lundi 19 septembre 2022

I want to create a settings popup in which the user can select the custom directory path to read files. How can I do that? [closed]

I had tested some files from the public folder of my Laravel app and the path for that is;

C:\xampp\htdocs\EDI_System\public\files\pending

but this one is static I want to make a setting popup where users can set a custom path for that like if the files exist in D:\new_files the setting popup appears and the selection of the directory can be made.

i want my settings to be like that

currently, I am getting the path and scanning files from this code.

      $path = public_path('files\pending');
    $allfiles = scandir($path);
    $allfiles = array_diff(scandir($path) , array(
        '.',
        '..'
    ));

The code is executing fine but how can I do it dynamically so that I can select the path from my app and use it instead of

          $path = public_path('files\pending');

Your help will be much appreciated. Thank you



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire