#1 2018-10-21 07:35:21

array81
Member
From: Italy
Registered: 2010-07-23
Posts: 411

Browser server folders from client on MVC application

On my MVC application the user on client (so as webpage) must be select a folder on server. The user must browser the server folders from a specific path not from root. Then select a folder and pur it on a input form.

Any suggestion about it?

Offline

#2 2018-10-22 06:19:56

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,237
Website

Re: Browser server folders from client on MVC application

It is more a web question than a framework question.
I don't think it is possible to have a folder name using the mime mechanism.

Offline

#3 2018-11-05 01:51:11

Ehab
Member
Registered: 2016-09-07
Posts: 15

Re: Browser server folders from client on MVC application

You can't browse the server but you can emulate it. Get the directories list and send them to the browser, then the browser display them as a tree for the user to select a folder.

To get the directories tree in Windows you can use something like this :

Procedure GetDirTree(SearchDir:String; RList: TStrings; SubDir:Boolean = True; Lvl:Integer= 0 );
var
  Path, Tmp :String ;
  SearchRec: TSearchRec;
begin
  Path := CheckPathEnd(SearchDir);
  if FindFirst(Path + '*', faAnyFile, SearchRec)= 0 then begin
    Tmp := StringOfChar(#9, Lvl);
    repeat
      if ( (SearchRec.Attr and faDirectory)= faDirectory ) and (SearchRec.Name[1] <> '.') then begin
        RList.Add(Tmp + SearchRec.Name);
        if SubDir then GetDirTree(Path + SearchRec.Name, RList, True, Lvl+1);
      end;
    until (FindNext(SearchRec) <> 0);
    FindClose(SearchRec.FindHandle);
  end;
end;

Offline

Board footer

Powered by FluxBB